graphite-code 1.7.1__tar.gz → 1.8.0__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.7.1 → graphite_code-1.8.0}/CHANGELOG.md +54 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/PKG-INFO +2 -2
- {graphite_code-1.7.1 → graphite_code-1.8.0}/README.md +1 -1
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/__init__.py +1 -1
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/cli.py +40 -2
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/freshness.py +25 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_engine_identity.py +78 -1
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_hardening.py +62 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_mutation_tests.py +216 -1
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_published_schemas.py +44 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/.gitignore +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/ARCHITECTURE.md +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/CONTRIBUTING.md +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/LICENSE +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/RELEASING.md +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/pyproject.toml +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/__main__.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/_cleanup_worker.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/_win32_ctypes.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/activation.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/agent_hooks.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/agent_settings.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/analyze.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/answer_contract.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/bootstrap.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/buildlock.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/cache.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/channel.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/cluster.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/config.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/context.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/daemon.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/daemon_health.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/daemon_launch.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/debt.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/dependency_install.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/detach.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/doctor.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/doctor_probes.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/engine_identity.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/export/__init__.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/export/html.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/export/json.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/export/md.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/extract/__init__.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/extract/ast.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/extract/pyscope.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/git.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/graph.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/graph_io.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/health.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/hook_entry.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/hookinstall.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/hookshim.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/incident_ledger.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/ingest.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/init.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/io.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/launchd_agent.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/listing.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/llm.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/llm_probe.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/mcp.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/mcp_server.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/natural_query.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/overlays.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/ownership.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/probe_process.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/probe_workspace.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/process_contracts.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/programs.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/provider_observer.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/py.typed +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/query.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/query_plan.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/replacement_audit.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/resolve.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/review.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/__init__.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/approval.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/classifier.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/claude_executor.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/claude_probe.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/cli_identity.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/codex_executor.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/codex_probe.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/context_builder.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/contracts.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/diff_policy.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/edit_apply.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/effort.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/lifecycle.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/lifecycle_operator.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/lifecycle_service.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/lifecycle_storage.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/ollama_executor.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/ollama_probe.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/openrouter_executor.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/openrouter_probe.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/policy.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/probe_runner.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/process_runner.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/profiles.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/prompt.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/registry.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/route_pool.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/route_pool_execution.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/schema_validation.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/service.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/settings.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/shadow.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/storage.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/telemetry.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/worktree.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/zai_edit.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/zai_executor.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/routing/zai_probe.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/savings.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/systemd_unit.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/ts_bridge.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/ts_resolver.mjs +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/typescript_activation.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/usage_ledger.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/validation.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/watch.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/windows_job.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/windows_startup.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/src/graphite/windows_task.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/conftest.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/data/sqloracle/blindspots.py.txt +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/data/sqloracle/round69.py.txt +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/fake_clis/fake_cli.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/fixtures/provider_lifecycle_schema_v1.sql +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/fixtures/routing_schema_v2_ca77600.sql +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/fixtures/routing_schema_v3_94eb333.sql +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/fixtures/routing_schema_v4_lifecycle_migration.sql +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test__win32_ctypes.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_activation.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_activation_backstop.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_agent_hook_activation.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_agent_hooks.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_agent_hooks_session_books.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_agent_hooks_session_tagging.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_agent_settings.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_answer_contract.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_arrow_and_constructor_binding.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_ast_make_id_length.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_ast_name_a_module_only_imports.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_ast_source_lines.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_ast_super_over_a_builtin_base.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_atomic_write.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_bootstrap.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_build_detach.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_buildlock.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cache_engine_identity.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cache_entry_pruning.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cache_file_identity.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cache_file_set.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cache_pruning.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_call_graph.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_case_ambiguous_answer.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_channel_attribution.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_channel_cli.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_channel_core.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_channel_kind.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_channel_lock.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_channel_log_integrity.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_channel_mcp.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_channel_register.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_channel_report.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_channel_status.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_class_field_arrow_binding.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cli_below_repository_root.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cli_build_missing_path.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cli_channel.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cli_channel_attribution.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cli_doctor_below_root.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cli_reference.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cli_usage.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cli_version.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cluster.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_compare_dist.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_configuration_reference.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_context.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_context_builder.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cwd_relative_config.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_cycle_search.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_daemon.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_daemon_activation.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_daemon_build_lock.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_daemon_child_lock.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_daemon_engine_staleness.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_daemon_health.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_daemon_health_activation.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_daemon_launch.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_daemon_service_cli.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_daemon_snapshot_failure.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_debt.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_dependency_install.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_destructured_binding.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_determinism.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_dispatch_evidence.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_doctor.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_doctor_agent_hooks.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_doctor_hooks.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_doctor_managed_docs.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_doctor_probes.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_documentation.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_edit_apply.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_exit_codes_reference.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_external_calls.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_file_node_id_collision.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_git_security.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_go_rust.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_graph_io.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_graph_provider_isolation.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_health.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_hook_entry.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_hook_template.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_hookinstall.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_hookshim.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_html_security.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_incident_ledger.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_init.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_init_activation_doctrine.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_init_hooks.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_init_validation_exit.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_launchd_agent.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_lifecycle_operator.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_listing.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_listing_surfaces.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_llm.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_llm_probe.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_mcp.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_mcp_server.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_mcp_server_channel_attribution.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_member_call_receiver.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_method_dispatch_scope.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_monorepo.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_natural_query.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_no_path_is_graded.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_node_identity.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_ollama_executor.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_overlays.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_path_leak_fixture.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_probe_diagnostics.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_probe_process.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_probe_workspace.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_process_contracts.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_programs.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_provider_claude_probe.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_provider_codex_probe.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_provider_lifecycle.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_provider_lifecycle_service.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_provider_lifecycle_storage.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_provider_observer.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_provider_ollama_probe.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_provider_openrouter_probe.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_provider_probe_runner.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_public_surface.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_pyscope.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_pyscopeoracle.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_python_builtin_named_symbols.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_python_import_bindings.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_python_inherits_edge.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_python_local_alias_call.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_python_reexport_follow.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_python_resolver.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_python_scope_identity.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_query_plan.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_reliability.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_replacement_audit.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_repository_root_ownership.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_resolve.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_resolve_python_reexports_of.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_review.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_route_pool.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_route_pool_execution.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_approval.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_benchmark.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_classifier.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_claude_executor.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_cli.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_cli_contracts.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_cli_recovery.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_codex_executor.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_context.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_contracts.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_diff_policy.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_executor.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_openrouter_executor.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_policy.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_process_runner.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_profiles.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_registry.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_schema_validation.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_security.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_service.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_shadow.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_storage.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_telemetry.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_worktree.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_zai_executor.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_routing_zai_probe.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_savings.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_search.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_self_super_dispatch.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_smoke.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_sqloracle.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_synthetic_repo.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_systemd_unit.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_ts_bridge.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_typescript_activation.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_typescript_resolver.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_usage_ledger.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_verify_artifact.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_verify_published_release.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_watch.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_windows_startup.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_windows_task.py +0 -0
- {graphite_code-1.7.1 → graphite_code-1.8.0}/tests/test_zai_edit.py +0 -0
|
@@ -15,6 +15,60 @@ machine-checkable identity; the version is for humans.
|
|
|
15
15
|
|
|
16
16
|
## [Unreleased]
|
|
17
17
|
|
|
18
|
+
## [1.8.0] — 2026-10-29
|
|
19
|
+
|
|
20
|
+
A minor release: one addition to a stable JSON output, and no change to any
|
|
21
|
+
command, option, exit code or entry point. By the rule in
|
|
22
|
+
`docs/compatibility.md` — "additions are minors" — a field added to a
|
|
23
|
+
versioned JSON output is a minor, not a patch.
|
|
24
|
+
|
|
25
|
+
**`check --json` names which part of the engine moved.** A graph built by one
|
|
26
|
+
engine and read by another reported `stale: true` with the reason
|
|
27
|
+
`engine_changed` and nothing else: no file difference, and no indication of
|
|
28
|
+
what had actually changed. The 1.7.0 pre-push gate hit exactly that — the
|
|
29
|
+
engine identity moved between two xdist workers while the files stayed put,
|
|
30
|
+
so the reason could not be named.
|
|
31
|
+
|
|
32
|
+
`check --json` now carries an `engine_delta` beside `reason`:
|
|
33
|
+
|
|
34
|
+
"engine_delta": {
|
|
35
|
+
"changed": ["fingerprint", "version"],
|
|
36
|
+
"previous": {"fingerprint": "3b1f2c4d5e6f…", "version": "1.7.0"},
|
|
37
|
+
"current": {"fingerprint": "9a2c8e0f1b3d…", "version": "1.7.1"}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
`changed` names the parts that moved (`version`, `cache_version`,
|
|
41
|
+
`schema_version`, `parsers`, `fingerprint`); `previous` and `current` give
|
|
42
|
+
what each moved from and to. A manifest that recorded no identity at all — a
|
|
43
|
+
legacy one, or a corrupt one — reports `previous: null`, because every part
|
|
44
|
+
of the current identity is *new* rather than different.
|
|
45
|
+
|
|
46
|
+
The human-readable output says the same in short form:
|
|
47
|
+
|
|
48
|
+
[graphite] graph is stale (engine_changed)
|
|
49
|
+
graphite was updated since this graph was built; rebuild to refresh
|
|
50
|
+
engine identity moved:
|
|
51
|
+
version: 1.7.0 -> 1.7.1
|
|
52
|
+
fingerprint: 3b1f2c4d5e6f... -> 9a2c8e0f1b3d...
|
|
53
|
+
|
|
54
|
+
`review-changes --json` is unaffected: its packet sanitizes the freshness
|
|
55
|
+
status down to a whitelist of keys, and `engine_delta` is not among them.
|
|
56
|
+
`doctor --json` is unaffected too — it reads only `stale` from the status.
|
|
57
|
+
|
|
58
|
+
**The mutation gate now certifies what it tests** (in the repository, not in
|
|
59
|
+
the package: neither the wheel nor the sdist carries `scripts/`). `scripts/mutation_tests.py`
|
|
60
|
+
runs the suite through a dev venv whose
|
|
61
|
+
editable install names the *canonical* repository's `src`, so a mutation
|
|
62
|
+
applied in a worktree was never the code the tests imported: no mutant could
|
|
63
|
+
be killed by the thing it changed, and a "survivor" said nothing about the
|
|
64
|
+
code it was said to survive in. The launcher now puts the tree's own `src`
|
|
65
|
+
first on `PYTHONPATH`, confirms that each mutated module resolves under the
|
|
66
|
+
tree it was given, and refuses with exit 70 if one resolves elsewhere rather
|
|
67
|
+
than certifying a run that never exercised the mutation. The import probe's
|
|
68
|
+
budget became a pinned policy with its edges asserted, and every mutation
|
|
69
|
+
verdict recorded before 2026-10-28 is untrustworthy in both directions. See
|
|
70
|
+
the release evidence for the measurements.
|
|
71
|
+
|
|
18
72
|
## [1.7.1] — 2026-10-28
|
|
19
73
|
|
|
20
74
|
A patch release: three fixes, and no change to any stable surface. No command,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: graphite-code
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.0
|
|
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.
|
|
52
|
+
**Status: 1.8.0, 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.
|
|
5
|
+
**Status: 1.8.0, 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.
|
|
41
|
+
__version__ = "1.8.0"
|
|
@@ -122,6 +122,11 @@ _DAEMON_STATUS_PROJECT_CAP = 20
|
|
|
122
122
|
_VALIDATE_ERROR_CAP = 10
|
|
123
123
|
_WATCH_IMPACTED_CAP = 20
|
|
124
124
|
_WATCH_TESTS_CAP = 30
|
|
125
|
+
# The `check --json` envelope's schema version. The published schema
|
|
126
|
+
# (docs/schemas/check.v1.schema.json) holds it as a `const`, and BOTH shapes
|
|
127
|
+
# of the answer carry it -- a stale graph, and a path below a repository's
|
|
128
|
+
# root -- so it is stamped from one place and the two cannot drift apart.
|
|
129
|
+
_CHECK_SCHEMA_VERSION = 1
|
|
125
130
|
# The repository size `capabilities` declares as supported, and what backs
|
|
126
131
|
# it. The binding limit is MAX_GRAPH_BYTES, not build time. Graph bytes per
|
|
127
132
|
# file depend on code density: the synthetic corpus in benchmarks/ yields
|
|
@@ -772,6 +777,38 @@ def cmd_report(args: argparse.Namespace) -> int:
|
|
|
772
777
|
return cmd_build(args)
|
|
773
778
|
|
|
774
779
|
|
|
780
|
+
def _print_engine_delta(delta: Any) -> None:
|
|
781
|
+
"""Name the part of the engine identity that moved.
|
|
782
|
+
|
|
783
|
+
The reason alone said THAT the engine moved and never WHICH part of it,
|
|
784
|
+
so the actor was never named: the 1.7.0 gate saw `check` report the graph
|
|
785
|
+
stale with no file difference and could say nothing more. The JSON
|
|
786
|
+
output carries the same detail in full; this is the short form.
|
|
787
|
+
"""
|
|
788
|
+
if not isinstance(delta, dict):
|
|
789
|
+
return
|
|
790
|
+
changed = delta.get("changed") or []
|
|
791
|
+
if not changed:
|
|
792
|
+
return
|
|
793
|
+
previous = delta.get("previous")
|
|
794
|
+
current = delta.get("current") or {}
|
|
795
|
+
print(" engine identity moved:")
|
|
796
|
+
for key in changed:
|
|
797
|
+
if isinstance(previous, dict):
|
|
798
|
+
before = _short_value(previous.get(key))
|
|
799
|
+
else:
|
|
800
|
+
before = "not recorded"
|
|
801
|
+
print(f" {key}: {before} -> {_short_value(current.get(key))}")
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
def _short_value(value: Any, limit: int = 12) -> str:
|
|
805
|
+
"""A value short enough to read on one line. A fingerprint is 64 hex
|
|
806
|
+
characters, and the first twelve of them identify it as well as the whole
|
|
807
|
+
does."""
|
|
808
|
+
text = str(value)
|
|
809
|
+
return text if len(text) <= limit else text[:limit] + "..."
|
|
810
|
+
|
|
811
|
+
|
|
775
812
|
def cmd_check(args: argparse.Namespace) -> int:
|
|
776
813
|
root = Path(args.path).resolve()
|
|
777
814
|
# Below a repository's root there is no graph to be fresh or stale, and
|
|
@@ -783,7 +820,7 @@ def cmd_check(args: argparse.Namespace) -> int:
|
|
|
783
820
|
if not args.json:
|
|
784
821
|
raise ValueError(_below_a_root(root, top))
|
|
785
822
|
status: dict[str, Any] = {
|
|
786
|
-
"schema_version":
|
|
823
|
+
"schema_version": _CHECK_SCHEMA_VERSION,
|
|
787
824
|
"stale": True,
|
|
788
825
|
"reason": "below_repository_root",
|
|
789
826
|
"repository_root": top.as_posix() if trusted_root(top) else None,
|
|
@@ -800,7 +837,7 @@ def cmd_check(args: argparse.Namespace) -> int:
|
|
|
800
837
|
cfg = _project_scoped_config(args, root, canonical=True)
|
|
801
838
|
status = check_graph_freshness(root, cfg, ignore_engine=args.ignore_engine)
|
|
802
839
|
if args.json:
|
|
803
|
-
status["schema_version"] =
|
|
840
|
+
status["schema_version"] = _CHECK_SCHEMA_VERSION
|
|
804
841
|
status["resolution_health"] = persisted_resolution(
|
|
805
842
|
root,
|
|
806
843
|
on_error=lambda exc: record_incident(
|
|
@@ -817,6 +854,7 @@ def cmd_check(args: argparse.Namespace) -> int:
|
|
|
817
854
|
print(f"[graphite] graph is stale ({reason})")
|
|
818
855
|
if reason == "engine_changed":
|
|
819
856
|
print(" graphite was updated since this graph was built; rebuild to refresh")
|
|
857
|
+
_print_engine_delta(status.get("engine_delta"))
|
|
820
858
|
for key in ("added", "changed", "removed"):
|
|
821
859
|
if status.get(key):
|
|
822
860
|
print(f" {key}: {', '.join(status[key])}")
|
|
@@ -38,6 +38,30 @@ def manifest_map(manifest: dict[str, Any]) -> dict[str, str]:
|
|
|
38
38
|
return {f["rel_path"]: f.get("hash", "") for f in manifest.get("files", []) if "rel_path" in f}
|
|
39
39
|
|
|
40
40
|
|
|
41
|
+
def engine_identity_delta(previous: Any, current: dict[str, Any]) -> dict[str, Any]:
|
|
42
|
+
"""Which part of the engine identity moved, and from what to what.
|
|
43
|
+
|
|
44
|
+
The identity is a flat map of strings, so a difference between two of them
|
|
45
|
+
is a difference of keys. Naming those keys is what makes the next
|
|
46
|
+
occurrence explain itself: `engine_changed` said THAT the engine moved and
|
|
47
|
+
never WHICH part of it, so the actor was never named -- the defect the
|
|
48
|
+
1.7.0 gate hit, where `check` reported the graph stale with no file
|
|
49
|
+
difference at all.
|
|
50
|
+
|
|
51
|
+
A previous identity that is not a map -- a legacy manifest that recorded
|
|
52
|
+
none, or a corrupt one -- is reported as such rather than as a difference:
|
|
53
|
+
every part of the current identity is new.
|
|
54
|
+
"""
|
|
55
|
+
if not isinstance(previous, dict):
|
|
56
|
+
return {"changed": sorted(current), "previous": None, "current": dict(current)}
|
|
57
|
+
changed = sorted(key for key in set(previous) | set(current) if previous.get(key) != current.get(key))
|
|
58
|
+
return {
|
|
59
|
+
"changed": changed,
|
|
60
|
+
"previous": {key: previous.get(key) for key in changed},
|
|
61
|
+
"current": {key: current.get(key) for key in changed},
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
41
65
|
def graph_engine_changed(cfg: Config, current_engine: dict[str, Any]) -> bool:
|
|
42
66
|
"""True when a built graph records an engine identity other than the current one.
|
|
43
67
|
|
|
@@ -116,6 +140,7 @@ def check_graph_freshness(
|
|
|
116
140
|
return {
|
|
117
141
|
"stale": True,
|
|
118
142
|
"reason": "engine_changed",
|
|
143
|
+
"engine_delta": engine_identity_delta(previous.get("engine"), current_engine),
|
|
119
144
|
"added": [],
|
|
120
145
|
"changed": [],
|
|
121
146
|
"removed": [],
|
|
@@ -202,12 +202,21 @@ def test_freshness_treats_legacy_manifest_as_engine_changed(tmp_path: Path) -> N
|
|
|
202
202
|
json.dumps({"root": root.name, "files": []}),
|
|
203
203
|
encoding="utf-8",
|
|
204
204
|
)
|
|
205
|
+
cfg = Config(output_dir=output)
|
|
205
206
|
|
|
206
|
-
result = check_graph_freshness(root,
|
|
207
|
+
result = check_graph_freshness(root, cfg)
|
|
207
208
|
|
|
209
|
+
# No identity was recorded at all, so every part of the current one is
|
|
210
|
+
# new -- which is what the delta says, rather than a difference.
|
|
211
|
+
current = engine_identity(cfg.cache_version)
|
|
208
212
|
assert result == {
|
|
209
213
|
"stale": True,
|
|
210
214
|
"reason": "engine_changed",
|
|
215
|
+
"engine_delta": {
|
|
216
|
+
"changed": sorted(current),
|
|
217
|
+
"previous": None,
|
|
218
|
+
"current": current,
|
|
219
|
+
},
|
|
211
220
|
"added": [],
|
|
212
221
|
"changed": [],
|
|
213
222
|
"removed": [],
|
|
@@ -256,7 +265,75 @@ def test_freshness_prioritizes_engine_mismatch_when_repository_is_unchanged(
|
|
|
256
265
|
assert result == {
|
|
257
266
|
"stale": True,
|
|
258
267
|
"reason": "engine_changed",
|
|
268
|
+
"engine_delta": {
|
|
269
|
+
"changed": ["fingerprint", "version"],
|
|
270
|
+
"previous": {"fingerprint": "0" * 64, "version": "old"},
|
|
271
|
+
"current": {"fingerprint": "1" * 64, "version": "new"},
|
|
272
|
+
},
|
|
259
273
|
"added": [],
|
|
260
274
|
"changed": [],
|
|
261
275
|
"removed": [],
|
|
262
276
|
}
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
def _seed_engine(root: Path, output: Path, engine: dict[str, str]) -> Config:
|
|
280
|
+
"""A project whose manifest records exactly `engine`."""
|
|
281
|
+
root.mkdir(parents=True, exist_ok=True)
|
|
282
|
+
output.mkdir(parents=True, exist_ok=True)
|
|
283
|
+
(output / ".graphite_manifest.json").write_text(
|
|
284
|
+
json.dumps({"root": root.name, "files": [], "engine": engine}),
|
|
285
|
+
encoding="utf-8",
|
|
286
|
+
)
|
|
287
|
+
return Config(output_dir=output)
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
def test_freshness_names_the_part_of_the_engine_that_moved(tmp_path: Path, monkeypatch) -> None:
|
|
291
|
+
"""The reason alone never named the actor; the delta does.
|
|
292
|
+
|
|
293
|
+
A `version` bump with byte-identical engine files is the case that
|
|
294
|
+
confused the 1.7.0 gate: the FILES did not change, so nothing comparing
|
|
295
|
+
file lists could see it, and `check` said only `engine_changed` -- with no
|
|
296
|
+
way to say what had moved.
|
|
297
|
+
"""
|
|
298
|
+
root = tmp_path / "project"
|
|
299
|
+
output = tmp_path / "graph-out"
|
|
300
|
+
cfg = Config(output_dir=output)
|
|
301
|
+
current = {
|
|
302
|
+
"version": "2.0.0",
|
|
303
|
+
"cache_version": cfg.cache_version,
|
|
304
|
+
"schema_version": "1",
|
|
305
|
+
"parsers": "parsers-1",
|
|
306
|
+
"fingerprint": "a" * 64,
|
|
307
|
+
}
|
|
308
|
+
_seed_engine(root, output, {**current, "version": "1.0.0"})
|
|
309
|
+
monkeypatch.setattr(freshness_module, "engine_identity", lambda _cache_version: current)
|
|
310
|
+
|
|
311
|
+
result = check_graph_freshness(root, cfg)
|
|
312
|
+
|
|
313
|
+
assert result["engine_delta"] == {
|
|
314
|
+
"changed": ["version"],
|
|
315
|
+
"previous": {"version": "1.0.0"},
|
|
316
|
+
"current": {"version": "2.0.0"},
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
def test_freshness_carries_no_engine_delta_when_the_engine_did_not_move(tmp_path: Path, monkeypatch) -> None:
|
|
321
|
+
"""A delta that is always present would be a delta nobody reads: it has
|
|
322
|
+
to be there exactly when something moved."""
|
|
323
|
+
root = tmp_path / "project"
|
|
324
|
+
output = tmp_path / "graph-out"
|
|
325
|
+
cfg = Config(output_dir=output)
|
|
326
|
+
current = {
|
|
327
|
+
"version": "2.0.0",
|
|
328
|
+
"cache_version": cfg.cache_version,
|
|
329
|
+
"schema_version": "1",
|
|
330
|
+
"parsers": "parsers-1",
|
|
331
|
+
"fingerprint": "a" * 64,
|
|
332
|
+
}
|
|
333
|
+
_seed_engine(root, output, current)
|
|
334
|
+
monkeypatch.setattr(freshness_module, "engine_identity", lambda _cache_version: current)
|
|
335
|
+
|
|
336
|
+
result = check_graph_freshness(root, cfg)
|
|
337
|
+
|
|
338
|
+
assert result["stale"] is False
|
|
339
|
+
assert "engine_delta" not in result
|
|
@@ -786,6 +786,68 @@ def test_check_names_engine_staleness_reason_without_json(tmp_path: Path, monkey
|
|
|
786
786
|
assert "engine_changed" in out
|
|
787
787
|
|
|
788
788
|
|
|
789
|
+
def _downgrade_the_recorded_engine_version(tmp_path: Path) -> str:
|
|
790
|
+
"""Make the graph's recorded engine identity differ ONLY in its version.
|
|
791
|
+
|
|
792
|
+
The 1.7.0 pre-push gate hit exactly this shape: `check` reported the
|
|
793
|
+
graph stale with the reason `engine_changed` and no file difference at
|
|
794
|
+
all, so the actor could not be named. Returns the real version.
|
|
795
|
+
"""
|
|
796
|
+
manifest_path = tmp_path / "graph-out" / ".graphite_manifest.json"
|
|
797
|
+
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
|
|
798
|
+
engine = manifest["engine"]
|
|
799
|
+
real_version = engine["version"]
|
|
800
|
+
manifest["engine"] = {**engine, "version": "1.0.0"}
|
|
801
|
+
manifest_path.write_text(json.dumps(manifest), encoding="utf-8")
|
|
802
|
+
return real_version
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
def test_check_json_names_the_part_of_the_engine_that_moved(tmp_path: Path, monkeypatch, capsys) -> None:
|
|
806
|
+
"""`engine_changed` said THAT the engine moved, never WHICH part of it."""
|
|
807
|
+
_write(tmp_path / "src" / "app.ts", "export const app = 1;\n")
|
|
808
|
+
monkeypatch.chdir(tmp_path)
|
|
809
|
+
assert main(["build", "."]) == 0
|
|
810
|
+
capsys.readouterr()
|
|
811
|
+
real_version = _downgrade_the_recorded_engine_version(tmp_path)
|
|
812
|
+
|
|
813
|
+
assert main(["check", ".", "--json"]) == 1
|
|
814
|
+
payload = json.loads(capsys.readouterr().out)
|
|
815
|
+
|
|
816
|
+
assert payload["reason"] == "engine_changed"
|
|
817
|
+
assert payload["engine_delta"]["changed"] == ["version"]
|
|
818
|
+
assert payload["engine_delta"]["previous"] == {"version": "1.0.0"}
|
|
819
|
+
assert payload["engine_delta"]["current"] == {"version": real_version}
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
def test_check_names_the_part_of_the_engine_that_moved_without_json(tmp_path: Path, monkeypatch, capsys) -> None:
|
|
823
|
+
"""The short form says it too: which part, and what it moved from and to."""
|
|
824
|
+
_write(tmp_path / "src" / "app.ts", "export const app = 1;\n")
|
|
825
|
+
monkeypatch.chdir(tmp_path)
|
|
826
|
+
assert main(["build", "."]) == 0
|
|
827
|
+
capsys.readouterr()
|
|
828
|
+
real_version = _downgrade_the_recorded_engine_version(tmp_path)
|
|
829
|
+
|
|
830
|
+
assert main(["check", "."]) == 1
|
|
831
|
+
out = capsys.readouterr().out
|
|
832
|
+
|
|
833
|
+
assert "engine identity moved" in out
|
|
834
|
+
assert f"version: 1.0.0 -> {real_version}" in out
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
def test_check_json_carries_no_engine_delta_when_the_graph_is_fresh(tmp_path: Path, monkeypatch, capsys) -> None:
|
|
838
|
+
"""A delta that is always there would be a delta nobody reads."""
|
|
839
|
+
_write(tmp_path / "src" / "app.ts", "export const app = 1;\n")
|
|
840
|
+
monkeypatch.chdir(tmp_path)
|
|
841
|
+
assert main(["build", "."]) == 0
|
|
842
|
+
capsys.readouterr()
|
|
843
|
+
|
|
844
|
+
assert main(["check", ".", "--json"]) == 0
|
|
845
|
+
payload = json.loads(capsys.readouterr().out)
|
|
846
|
+
|
|
847
|
+
assert payload["stale"] is False
|
|
848
|
+
assert "engine_delta" not in payload
|
|
849
|
+
|
|
850
|
+
|
|
789
851
|
def test_check_ignore_engine_reports_source_drift_only(tmp_path: Path, monkeypatch, capsys) -> None:
|
|
790
852
|
_write(tmp_path / "src" / "app.ts", "export const app = 1;\n")
|
|
791
853
|
monkeypatch.chdir(tmp_path)
|
|
@@ -189,9 +189,11 @@ class _Runs:
|
|
|
189
189
|
def __init__(self, codes: list[int]) -> None:
|
|
190
190
|
self.codes = list(codes)
|
|
191
191
|
self.calls: list[tuple[list[str], Path]] = []
|
|
192
|
+
self.envs: list[dict[str, str] | None] = []
|
|
192
193
|
|
|
193
|
-
def __call__(self, argv: list[str], cwd: Path) -> int:
|
|
194
|
+
def __call__(self, argv: list[str], cwd: Path, env: dict[str, str] | None = None) -> int:
|
|
194
195
|
self.calls.append((list(argv), cwd))
|
|
196
|
+
self.envs.append(env)
|
|
195
197
|
assert self.codes, "the launcher started more stages than the test scripted"
|
|
196
198
|
return self.codes.pop(0)
|
|
197
199
|
|
|
@@ -496,3 +498,216 @@ def test_git_helper_with_no_git_outside_the_tree_reads_as_a_failure(
|
|
|
496
498
|
monkeypatch.setenv("PATH", str(tree))
|
|
497
499
|
|
|
498
500
|
assert launcher._git(tree, "status") == ""
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
# --- the tree under test is the tree that is imported ------------------------
|
|
504
|
+
#
|
|
505
|
+
# MEASURED 2026-10-28 on this machine, in aramid's own mutation shape: the
|
|
506
|
+
# consumer applies a mutation to a WORKTREE and runs this launcher from it.
|
|
507
|
+
# The launcher runs the suite through the dev venv, whose editable install
|
|
508
|
+
# names the CANONICAL repository's `src` -- so the worktree's mutation was
|
|
509
|
+
# never the code the tests imported, and the gate certified nothing.
|
|
510
|
+
#
|
|
511
|
+
# mutation src/graphite/cli.py:786, `"schema_version": 1,` -> `2`
|
|
512
|
+
# killer tests/test_published_schemas.py::
|
|
513
|
+
# test_check_output_below_a_repository_root_matches_published_schema
|
|
514
|
+
#
|
|
515
|
+
# in the consumer's shape (worktree, no PYTHONPATH) the killer PASSED
|
|
516
|
+
# with the tree under test on PYTHONPATH the killer FAILED
|
|
517
|
+
# (`assert 2 == 1`)
|
|
518
|
+
#
|
|
519
|
+
# The same held for a mutation that makes a module unimportable, at the head
|
|
520
|
+
# the consumer itself used (43fdfcf): 589 tests passed in the consumer's shape
|
|
521
|
+
# and collection ERRORED with the tree under test imported.
|
|
522
|
+
#
|
|
523
|
+
# So the import path is pinned here, and PINNED LOUDLY: a launcher that
|
|
524
|
+
# cannot confirm the mutated module is the one that will be imported must
|
|
525
|
+
# refuse to certify rather than report a clean run.
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
def _src_layout(root: Path) -> Path:
|
|
529
|
+
"""A `src/graphite` package under `root`, as this repository has."""
|
|
530
|
+
package = root / "src" / "graphite"
|
|
531
|
+
package.mkdir(parents=True)
|
|
532
|
+
(package / "__init__.py").write_text("", encoding="utf-8")
|
|
533
|
+
return package
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
def test_package_root_is_the_src_directory_of_a_src_layout(
|
|
537
|
+
tmp_path: Path, launcher: ModuleType
|
|
538
|
+
) -> None:
|
|
539
|
+
root = tmp_path / "repo"
|
|
540
|
+
_src_layout(root)
|
|
541
|
+
|
|
542
|
+
assert launcher._package_root(root) == root / "src"
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
def test_package_root_is_the_root_itself_when_there_is_no_src_layout(
|
|
546
|
+
tmp_path: Path, launcher: ModuleType
|
|
547
|
+
) -> None:
|
|
548
|
+
root = tmp_path / "repo"
|
|
549
|
+
(root / "graphite").mkdir(parents=True)
|
|
550
|
+
(root / "graphite" / "__init__.py").write_text("", encoding="utf-8")
|
|
551
|
+
|
|
552
|
+
assert launcher._package_root(root) == root
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
def test_test_environment_puts_the_tree_under_test_first_on_the_import_path(
|
|
556
|
+
tmp_path: Path, launcher: ModuleType, monkeypatch: pytest.MonkeyPatch
|
|
557
|
+
) -> None:
|
|
558
|
+
root = tmp_path / "repo"
|
|
559
|
+
_src_layout(root)
|
|
560
|
+
elsewhere = tmp_path / "elsewhere"
|
|
561
|
+
monkeypatch.setenv("PYTHONPATH", str(elsewhere))
|
|
562
|
+
|
|
563
|
+
env = launcher._test_environment(root)
|
|
564
|
+
|
|
565
|
+
assert env["PYTHONPATH"].split(os.pathsep) == [str(root / "src"), str(elsewhere)]
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
def test_imported_module_reports_where_the_interpreter_resolves_it(
|
|
569
|
+
tmp_path: Path, launcher: ModuleType
|
|
570
|
+
) -> None:
|
|
571
|
+
package = tmp_path / "pkg"
|
|
572
|
+
package.mkdir()
|
|
573
|
+
(package / "thing.py").write_text("", encoding="utf-8")
|
|
574
|
+
env = dict(os.environ)
|
|
575
|
+
env["PYTHONPATH"] = str(package)
|
|
576
|
+
|
|
577
|
+
assert launcher._imported_module(sys.executable, env, "thing", tmp_path) == str(
|
|
578
|
+
package / "thing.py"
|
|
579
|
+
)
|
|
580
|
+
# A module that cannot be imported is not a verdict about the tree.
|
|
581
|
+
assert launcher._imported_module(sys.executable, env, "no_such_module", tmp_path) is None
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
def test_main_gives_the_pytest_stages_the_tree_under_test_on_the_import_path(
|
|
585
|
+
launcher: ModuleType, monkeypatch: pytest.MonkeyPatch, staged: tuple[Path, Path, Path]
|
|
586
|
+
) -> None:
|
|
587
|
+
root, python, _log_path = staged
|
|
588
|
+
_src_layout(root)
|
|
589
|
+
runs = _Runs([0, 0])
|
|
590
|
+
monkeypatch.setattr(launcher, "_run", runs)
|
|
591
|
+
monkeypatch.setattr(launcher, "_dev_python", lambda *roots: python)
|
|
592
|
+
monkeypatch.setattr(
|
|
593
|
+
launcher,
|
|
594
|
+
"_imported_module",
|
|
595
|
+
lambda *args: str(root / "src" / "graphite" / "foo.py"),
|
|
596
|
+
)
|
|
597
|
+
|
|
598
|
+
assert launcher.main([]) == 0
|
|
599
|
+
|
|
600
|
+
assert runs.envs, "the stages ran with no environment at all"
|
|
601
|
+
for env in runs.envs:
|
|
602
|
+
assert env is not None
|
|
603
|
+
assert env["PYTHONPATH"].split(os.pathsep)[0] == str(root / "src")
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
def test_main_refuses_to_certify_a_mutation_imported_from_outside_the_tree(
|
|
607
|
+
launcher: ModuleType,
|
|
608
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
609
|
+
staged: tuple[Path, Path, Path],
|
|
610
|
+
capsys: pytest.CaptureFixture[str],
|
|
611
|
+
) -> None:
|
|
612
|
+
root, python, log_path = staged
|
|
613
|
+
_src_layout(root)
|
|
614
|
+
runs = _Runs([])
|
|
615
|
+
monkeypatch.setattr(launcher, "_run", runs)
|
|
616
|
+
monkeypatch.setattr(launcher, "_dev_python", lambda *roots: python)
|
|
617
|
+
# The module resolves -- but somewhere else, which is the case the gate
|
|
618
|
+
# must NOT certify: the mutation would never be exercised.
|
|
619
|
+
monkeypatch.setattr(
|
|
620
|
+
launcher,
|
|
621
|
+
"_imported_module",
|
|
622
|
+
lambda *args: str(Path("F:/Projects/graphite/src/graphite/foo.py")),
|
|
623
|
+
)
|
|
624
|
+
|
|
625
|
+
assert launcher.main([]) == 70
|
|
626
|
+
|
|
627
|
+
assert runs.calls == [], "a stage ran while the tree under test was not the imported one"
|
|
628
|
+
err = capsys.readouterr().err
|
|
629
|
+
assert "outside" in err
|
|
630
|
+
(record,) = _log_lines(log_path)
|
|
631
|
+
assert record["rc"] == 70
|
|
632
|
+
assert record["import_root"] == str(Path("F:/Projects/graphite/src/graphite/foo.py"))
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
# --- the import probe's budget is a policy, and it is pinned ------------------
|
|
636
|
+
#
|
|
637
|
+
# MEASURED 2026-10-28: the mutation gate, working for the first time, found
|
|
638
|
+
# this survivor -- `mutant survived: 120 -> 121 in _imported_module`. The old
|
|
639
|
+
# bare `120` was in the `subprocess.run` call and NOTHING asserted it, so a
|
|
640
|
+
# change to it was invisible to the whole suite. A budget nobody checks is a
|
|
641
|
+
# budget nobody has decided.
|
|
642
|
+
#
|
|
643
|
+
# MEASURED 2026-10-29: the SAME class, twice more, in the fix's own new code.
|
|
644
|
+
# The boundary `value > 0` was asserted nowhere, so the mutation that moved it
|
|
645
|
+
# to `value > 1` survived (ledger 1b1643b5); and `str.isdigit` admits a
|
|
646
|
+
# superscript two, which `int` cannot parse, so an operator's value CRASHED
|
|
647
|
+
# the launcher instead of falling back. A budget nobody checks is a budget
|
|
648
|
+
# nobody has decided -- including its edges.
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
def test_import_timeout_is_the_pinned_default_without_an_operator_value(
|
|
652
|
+
launcher: ModuleType, monkeypatch: pytest.MonkeyPatch
|
|
653
|
+
) -> None:
|
|
654
|
+
monkeypatch.delenv(launcher._IMPORT_TIMEOUT_ENV, raising=False)
|
|
655
|
+
|
|
656
|
+
assert launcher._import_timeout_seconds() == 120
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
def test_import_timeout_follows_the_operator_value(
|
|
660
|
+
launcher: ModuleType, monkeypatch: pytest.MonkeyPatch
|
|
661
|
+
) -> None:
|
|
662
|
+
monkeypatch.setenv(launcher._IMPORT_TIMEOUT_ENV, "45")
|
|
663
|
+
|
|
664
|
+
assert launcher._import_timeout_seconds() == 45
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
@pytest.mark.parametrize("nonsense", ["", " ", "abc", "0", "-5", "1.5", "45s"])
|
|
668
|
+
def test_import_timeout_falls_back_to_the_default_on_a_nonsense_value(
|
|
669
|
+
launcher: ModuleType, monkeypatch: pytest.MonkeyPatch, nonsense: str
|
|
670
|
+
) -> None:
|
|
671
|
+
monkeypatch.setenv(launcher._IMPORT_TIMEOUT_ENV, nonsense)
|
|
672
|
+
|
|
673
|
+
assert launcher._import_timeout_seconds() == 120
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
def test_import_timeout_honours_the_smallest_positive_value(
|
|
677
|
+
launcher: ModuleType, monkeypatch: pytest.MonkeyPatch
|
|
678
|
+
) -> None:
|
|
679
|
+
# The LOWER boundary is a policy too: a positive value is the operator's
|
|
680
|
+
# budget, including the smallest one. The mutation that moved this
|
|
681
|
+
# boundary (`value > 0` -> `value > 1`) SURVIVED the suite -- the drain
|
|
682
|
+
# recorded it on 2026-10-28, against PR #129's own new code.
|
|
683
|
+
monkeypatch.setenv(launcher._IMPORT_TIMEOUT_ENV, "1")
|
|
684
|
+
|
|
685
|
+
assert launcher._import_timeout_seconds() == 1
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
def test_import_timeout_falls_back_on_a_digit_that_is_not_a_number(
|
|
689
|
+
launcher: ModuleType, monkeypatch: pytest.MonkeyPatch
|
|
690
|
+
) -> None:
|
|
691
|
+
# `"²".isdigit()` is True and `int("²")` raises, so a value the operator
|
|
692
|
+
# set used to CRASH the gate's launcher instead of falling back. MEASURED
|
|
693
|
+
# 2026-10-29: `GRAPHITE_MUTATION_IMPORT_TIMEOUT_S=²` raised ValueError.
|
|
694
|
+
monkeypatch.setenv(launcher._IMPORT_TIMEOUT_ENV, "²")
|
|
695
|
+
|
|
696
|
+
assert launcher._import_timeout_seconds() == 120
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
def test_imported_module_gives_the_probe_the_configured_budget(
|
|
700
|
+
launcher: ModuleType, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
|
701
|
+
) -> None:
|
|
702
|
+
seen: list[dict[str, object]] = []
|
|
703
|
+
|
|
704
|
+
def record(argv: list[str], **kwargs: object) -> subprocess.CompletedProcess[str]:
|
|
705
|
+
seen.append(kwargs)
|
|
706
|
+
return subprocess.CompletedProcess(argv, 0, stdout="x\n", stderr="")
|
|
707
|
+
|
|
708
|
+
monkeypatch.setattr(launcher.subprocess, "run", record)
|
|
709
|
+
monkeypatch.setenv(launcher._IMPORT_TIMEOUT_ENV, "45")
|
|
710
|
+
|
|
711
|
+
launcher._imported_module(Path("python"), dict(os.environ), "thing", tmp_path)
|
|
712
|
+
|
|
713
|
+
assert seen and seen[0]["timeout"] == 45
|
|
@@ -216,6 +216,50 @@ def test_check_output_below_a_repository_root_matches_published_schema(tmp_path,
|
|
|
216
216
|
assert matches_schema(payload, _load("check.v1.schema.json")) is True
|
|
217
217
|
|
|
218
218
|
|
|
219
|
+
def test_the_check_envelope_version_is_the_published_schema_version() -> None:
|
|
220
|
+
"""The code's constant and the published schema must agree.
|
|
221
|
+
|
|
222
|
+
`check --json` stamps its schema version from one place now, because its
|
|
223
|
+
two shapes -- a stale graph, and a path below a repository's root -- have
|
|
224
|
+
to carry the same one. If that place and the published schema's `const`
|
|
225
|
+
ever disagree, every `check --json` answer is a payload the contract it
|
|
226
|
+
claims to keep rejects.
|
|
227
|
+
"""
|
|
228
|
+
from graphite.cli import _CHECK_SCHEMA_VERSION
|
|
229
|
+
|
|
230
|
+
schema = _load("check.v1.schema.json")
|
|
231
|
+
|
|
232
|
+
assert schema["properties"]["schema_version"]["const"] == _CHECK_SCHEMA_VERSION
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def test_check_engine_changed_output_matches_published_schema(tmp_path, capsys) -> None:
|
|
236
|
+
"""The `engine_changed` shape is a versioned output too.
|
|
237
|
+
|
|
238
|
+
`engine_delta` is part of the published v1 contract, so the shape a
|
|
239
|
+
consumer sees when the engine moved has to validate against the same
|
|
240
|
+
schema the other two `check --json` shapes are held to.
|
|
241
|
+
"""
|
|
242
|
+
from graphite.config import Config
|
|
243
|
+
from graphite.engine_identity import engine_identity
|
|
244
|
+
|
|
245
|
+
output = tmp_path / "graph-out"
|
|
246
|
+
output.mkdir()
|
|
247
|
+
current = engine_identity(Config().cache_version)
|
|
248
|
+
(output / ".graphite_manifest.json").write_text(
|
|
249
|
+
json.dumps(
|
|
250
|
+
{"root": tmp_path.name, "files": [], "engine": {**current, "version": "1.0.0"}}
|
|
251
|
+
),
|
|
252
|
+
encoding="utf-8",
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
assert main(["check", str(tmp_path), "--json"]) == 1
|
|
256
|
+
payload = json.loads(capsys.readouterr().out)
|
|
257
|
+
|
|
258
|
+
assert payload["reason"] == "engine_changed"
|
|
259
|
+
assert payload["engine_delta"]["changed"] == ["version"]
|
|
260
|
+
assert matches_schema(payload, _load("check.v1.schema.json")) is True
|
|
261
|
+
|
|
262
|
+
|
|
219
263
|
def test_validate_output_matches_published_schema(tmp_path, capsys) -> None:
|
|
220
264
|
"""`validate --json` is a versioned output, and the promise is kept."""
|
|
221
265
|
bundle = {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|