graphite-code 1.8.2__tar.gz → 1.9.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.8.2 → graphite_code-1.9.0}/CHANGELOG.md +31 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/PKG-INFO +2 -2
- {graphite_code-1.8.2 → graphite_code-1.9.0}/README.md +1 -1
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/__init__.py +1 -1
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/cli.py +34 -2
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/engine_identity.py +110 -17
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/freshness.py +28 -2
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cache_engine_identity.py +6 -2
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_engine_identity.py +52 -10
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_hardening.py +105 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_reliability.py +5 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/.gitignore +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/.mcp.json +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/ARCHITECTURE.md +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/CONTRIBUTING.md +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/LICENSE +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/RELEASING.md +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/SECURITY.md +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/benchmarks/__init__.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/benchmarks/build_benchmark.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/benchmarks/realty_router/README.md +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/benchmarks/realty_router/__init__.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/benchmarks/realty_router/evaluate.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/benchmarks/realty_router/tasks.json +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/benchmarks/synthetic_repo.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/pyproject.toml +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/scripts/__init__.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/scripts/compare_dist.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/scripts/gen_cli_reference.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/scripts/mutation_tests.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/scripts/pyscopeoracle.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/scripts/sqloracle.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/scripts/verify_artifact.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/scripts/verify_published_release.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/__main__.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/_cleanup_worker.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/_win32_ctypes.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/activation.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/agent_hooks.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/agent_settings.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/analyze.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/answer_contract.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/bootstrap.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/buildlock.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/cache.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/channel.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/cluster.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/config.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/context.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/daemon.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/daemon_health.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/daemon_launch.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/debt.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/dependency_install.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/detach.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/doctor.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/doctor_probes.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/export/__init__.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/export/html.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/export/json.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/export/md.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/extract/__init__.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/extract/ast.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/extract/pyscope.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/git.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/graph.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/graph_io.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/health.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/hook_entry.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/hookinstall.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/hookshim.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/incident_ledger.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/ingest.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/init.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/io.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/launchd_agent.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/listing.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/llm.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/llm_probe.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/mcp.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/mcp_server.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/natural_query.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/overlays.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/ownership.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/probe_process.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/probe_workspace.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/process_contracts.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/programs.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/provider_observer.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/py.typed +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/query.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/query_plan.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/replacement_audit.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/resolve.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/review.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/__init__.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/approval.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/classifier.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/claude_executor.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/claude_probe.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/cli_identity.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/codex_executor.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/codex_probe.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/context_builder.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/contracts.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/diff_policy.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/edit_apply.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/effort.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/lifecycle.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/lifecycle_operator.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/lifecycle_service.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/lifecycle_storage.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/ollama_executor.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/ollama_probe.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/openrouter_executor.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/openrouter_probe.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/policy.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/probe_runner.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/process_runner.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/profiles.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/prompt.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/registry.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/route_pool.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/route_pool_execution.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/schema_validation.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/service.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/settings.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/shadow.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/storage.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/telemetry.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/worktree.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/zai_edit.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/zai_executor.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/routing/zai_probe.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/savings.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/systemd_unit.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/ts_bridge.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/ts_resolver.mjs +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/typescript_activation.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/usage_ledger.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/validation.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/watch.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/windows_job.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/windows_startup.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/src/graphite/windows_task.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/conftest.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/data/sqloracle/blindspots.py.txt +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/data/sqloracle/round69.py.txt +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/fake_clis/fake_cli.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/fixtures/provider_lifecycle_schema_v1.sql +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/fixtures/routing_schema_v2_ca77600.sql +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/fixtures/routing_schema_v3_94eb333.sql +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/fixtures/routing_schema_v4_lifecycle_migration.sql +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test__win32_ctypes.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_activation.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_activation_backstop.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_agent_hook_activation.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_agent_hooks.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_agent_hooks_session_books.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_agent_hooks_session_tagging.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_agent_settings.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_answer_contract.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_arrow_and_constructor_binding.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_ast_make_id_length.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_ast_name_a_module_only_imports.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_ast_source_lines.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_ast_super_over_a_builtin_base.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_atomic_write.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_bootstrap.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_build_detach.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_buildlock.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cache_entry_pruning.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cache_file_identity.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cache_file_set.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cache_pruning.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_call_graph.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_case_ambiguous_answer.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_channel_attribution.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_channel_cli.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_channel_core.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_channel_kind.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_channel_lock.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_channel_log_integrity.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_channel_mcp.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_channel_register.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_channel_report.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_channel_status.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_class_field_arrow_binding.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cli_below_repository_root.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cli_build_missing_path.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cli_channel.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cli_channel_attribution.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cli_doctor_below_root.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cli_reference.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cli_usage.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cli_version.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cluster.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_compare_dist.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_configuration_reference.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_context.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_context_builder.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cwd_relative_config.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_cycle_search.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_daemon.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_daemon_activation.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_daemon_build_lock.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_daemon_child_lock.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_daemon_engine_staleness.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_daemon_health.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_daemon_health_activation.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_daemon_launch.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_daemon_service_cli.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_daemon_snapshot_failure.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_debt.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_dependency_install.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_destructured_binding.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_determinism.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_dispatch_evidence.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_doctor.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_doctor_agent_hooks.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_doctor_hooks.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_doctor_managed_docs.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_doctor_probes.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_documentation.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_edit_apply.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_exit_codes_reference.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_external_calls.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_file_node_id_collision.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_git_security.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_go_rust.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_graph_io.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_graph_provider_isolation.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_health.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_hook_entry.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_hook_template.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_hookinstall.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_hookshim.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_html_security.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_incident_ledger.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_init.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_init_activation_doctrine.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_init_hooks.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_init_validation_exit.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_launchd_agent.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_lifecycle_operator.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_listing.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_listing_surfaces.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_llm.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_llm_probe.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_mcp.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_mcp_server.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_mcp_server_channel_attribution.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_member_call_receiver.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_method_dispatch_scope.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_monorepo.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_mutation_tests.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_natural_query.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_no_path_is_graded.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_node_identity.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_ollama_executor.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_overlays.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_path_leak_fixture.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_probe_diagnostics.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_probe_process.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_probe_workspace.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_process_contracts.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_programs.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_provider_claude_probe.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_provider_codex_probe.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_provider_lifecycle.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_provider_lifecycle_service.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_provider_lifecycle_storage.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_provider_observer.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_provider_ollama_probe.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_provider_openrouter_probe.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_provider_probe_runner.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_public_surface.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_published_schemas.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_pyscope.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_pyscopeoracle.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_python_builtin_named_symbols.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_python_import_bindings.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_python_inherits_edge.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_python_local_alias_call.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_python_reexport_follow.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_python_resolver.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_python_scope_identity.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_query_plan.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_replacement_audit.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_repository_root_ownership.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_resolve.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_resolve_python_reexports_of.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_review.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_route_pool.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_route_pool_execution.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_approval.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_benchmark.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_classifier.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_claude_executor.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_cli.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_cli_contracts.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_cli_recovery.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_codex_executor.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_context.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_contracts.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_diff_policy.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_executor.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_openrouter_executor.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_policy.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_process_runner.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_profiles.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_registry.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_schema_validation.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_security.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_service.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_shadow.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_storage.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_telemetry.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_worktree.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_zai_executor.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_routing_zai_probe.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_savings.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_search.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_self_super_dispatch.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_smoke.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_sqloracle.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_synthetic_repo.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_systemd_unit.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_ts_bridge.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_typescript_activation.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_typescript_resolver.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_usage_ledger.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_verify_artifact.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_verify_published_release.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_watch.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_windows_startup.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_windows_task.py +0 -0
- {graphite_code-1.8.2 → graphite_code-1.9.0}/tests/test_zai_edit.py +0 -0
|
@@ -15,6 +15,37 @@ machine-checkable identity; the version is for humans.
|
|
|
15
15
|
|
|
16
16
|
## [Unreleased]
|
|
17
17
|
|
|
18
|
+
## [1.9.0] — 2026-10-31
|
|
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 versioned
|
|
23
|
+
JSON output is a minor, not a patch.
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
**`check` now names the engine file that moved, not just the fact that the
|
|
28
|
+
engine moved.** `engine_changed` reported that graphite's own engine had
|
|
29
|
+
changed since the graph was built and listed no files — and that was
|
|
30
|
+
structural, not an oversight: the engine's fingerprint covers the *package*
|
|
31
|
+
directory while the file-level diff covers the *repository* being checked, so
|
|
32
|
+
the file that moved was in neither list, and the repository's `added`,
|
|
33
|
+
`changed` and `removed` were empty by construction. The 1.7.0 pre-push gate
|
|
34
|
+
hit exactly this and could say nothing about what had moved.
|
|
35
|
+
|
|
36
|
+
The build now records the engine's file inventory in the manifest, and
|
|
37
|
+
`check --json` reports the difference as `engine_files`
|
|
38
|
+
(`added`/`changed`/`removed`, relative to the engine's package root, so no
|
|
39
|
+
absolute path is disclosed). The short form names the files too. When the
|
|
40
|
+
manifest records no inventory — one written before this, or an engine that
|
|
41
|
+
cannot be read — the answer is `null`, not an empty list: "no file changed"
|
|
42
|
+
and "we do not know" are different claims.
|
|
43
|
+
|
|
44
|
+
The engine's *fingerprint* is unchanged, byte for byte: this adds a record
|
|
45
|
+
beside the identity, and no existing graph is invalidated by it. The inventory
|
|
46
|
+
comes out of the pass the fingerprint already made, so the build does not read
|
|
47
|
+
the package twice — measured at 127 ms per build before and after.
|
|
48
|
+
|
|
18
49
|
## [1.8.2] — 2026-10-30
|
|
19
50
|
|
|
20
51
|
A patch release: one fix, and no change to any stable surface. What a source
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: graphite-code
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9.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.9.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.9.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.9.0"
|
|
@@ -42,7 +42,7 @@ from .daemon_health import HealthOptions, evaluate_daemon_health, format_health_
|
|
|
42
42
|
from . import buildlock
|
|
43
43
|
from .detach import spawn_detached
|
|
44
44
|
from .doctor import format_doctor_text, run_doctor
|
|
45
|
-
from .engine_identity import engine_identity
|
|
45
|
+
from .engine_identity import engine_identity, engine_identity_and_files
|
|
46
46
|
from .export.html import to_html as export_html
|
|
47
47
|
from .export.json import build_bundle, to_json as export_json
|
|
48
48
|
from .export.md import to_markdown as export_md
|
|
@@ -277,10 +277,18 @@ def _scan(args: argparse.Namespace, cfg: Config) -> tuple[dict[str, Any], list[A
|
|
|
277
277
|
|
|
278
278
|
start = time.time()
|
|
279
279
|
entries = collect_files(root, cfg)
|
|
280
|
+
# One pass over the engine's files yields both the identity and the
|
|
281
|
+
# inventory, so the inventory costs nothing beyond what the fingerprint
|
|
282
|
+
# already cost.
|
|
283
|
+
engine, engine_files = engine_identity_and_files(cfg.cache_version)
|
|
280
284
|
manifest = {
|
|
281
285
|
"root": root.name,
|
|
282
286
|
"file_count": len(entries),
|
|
283
|
-
"engine":
|
|
287
|
+
"engine": engine,
|
|
288
|
+
# The engine's own files, so a later `check` can name WHICH of them
|
|
289
|
+
# moved when the identity does. The fingerprint alone cannot: it says
|
|
290
|
+
# that something under the package directory changed and not what.
|
|
291
|
+
"engine_files": engine_files,
|
|
284
292
|
"files": [
|
|
285
293
|
{"rel_path": e.rel_path, "language": e.language, "size": e.size, "hash": e.content_hash}
|
|
286
294
|
for e in entries
|
|
@@ -809,6 +817,29 @@ def _short_value(value: Any, limit: int = 12) -> str:
|
|
|
809
817
|
return text if len(text) <= limit else text[:limit] + "..."
|
|
810
818
|
|
|
811
819
|
|
|
820
|
+
def _print_engine_files(files: Any) -> None:
|
|
821
|
+
"""Name the engine's own files that moved, when they are known.
|
|
822
|
+
|
|
823
|
+
`engine_changed` otherwise says only THAT the engine moved. The file
|
|
824
|
+
names are what a consumer can act on, and they are what the 1.7.0 gate
|
|
825
|
+
could not report.
|
|
826
|
+
"""
|
|
827
|
+
if not isinstance(files, dict):
|
|
828
|
+
return
|
|
829
|
+
named: list[str] = []
|
|
830
|
+
for key in ("changed", "added", "removed"):
|
|
831
|
+
values = files.get(key)
|
|
832
|
+
if not isinstance(values, list):
|
|
833
|
+
continue
|
|
834
|
+
for name in values:
|
|
835
|
+
named.append(f"{key}: {name}")
|
|
836
|
+
if not named:
|
|
837
|
+
return
|
|
838
|
+
print(" engine files that moved:")
|
|
839
|
+
for line in named:
|
|
840
|
+
print(f" {line}")
|
|
841
|
+
|
|
842
|
+
|
|
812
843
|
def cmd_check(args: argparse.Namespace) -> int:
|
|
813
844
|
root = Path(args.path).resolve()
|
|
814
845
|
# Below a repository's root there is no graph to be fresh or stale, and
|
|
@@ -855,6 +886,7 @@ def cmd_check(args: argparse.Namespace) -> int:
|
|
|
855
886
|
if reason == "engine_changed":
|
|
856
887
|
print(" graphite was updated since this graph was built; rebuild to refresh")
|
|
857
888
|
_print_engine_delta(status.get("engine_delta"))
|
|
889
|
+
_print_engine_files(status.get("engine_files"))
|
|
858
890
|
for key in ("added", "changed", "removed"):
|
|
859
891
|
if status.get(key):
|
|
860
892
|
print(f" {key}: {', '.join(status[key])}")
|
|
@@ -5,6 +5,7 @@ import hashlib
|
|
|
5
5
|
import json
|
|
6
6
|
import os
|
|
7
7
|
import stat
|
|
8
|
+
from collections.abc import Iterator
|
|
8
9
|
from importlib import metadata
|
|
9
10
|
from pathlib import Path
|
|
10
11
|
from typing import Final
|
|
@@ -172,7 +173,36 @@ def _parser_record(name: str) -> str:
|
|
|
172
173
|
return f"{name}=absent"
|
|
173
174
|
|
|
174
175
|
|
|
175
|
-
def
|
|
176
|
+
def _read_engine_files(
|
|
177
|
+
root: Path,
|
|
178
|
+
*,
|
|
179
|
+
max_files: int,
|
|
180
|
+
max_file_bytes: int,
|
|
181
|
+
max_total_bytes: int,
|
|
182
|
+
) -> Iterator[tuple[str, bytes]]:
|
|
183
|
+
"""Every engine source file, in a stable order, with the byte budget enforced.
|
|
184
|
+
|
|
185
|
+
One pass, so that the fingerprint and the file inventory cost what the
|
|
186
|
+
fingerprint alone used to cost: reading the package twice would double
|
|
187
|
+
every build.
|
|
188
|
+
"""
|
|
189
|
+
paths = _collect_engine_files(root, max_files=max_files)
|
|
190
|
+
inventory: list[tuple[str, Path]] = [(_contained_relative(path, root), path) for path in paths]
|
|
191
|
+
total_bytes = 0
|
|
192
|
+
for relative, path in sorted(inventory, key=lambda item: item[0]):
|
|
193
|
+
try:
|
|
194
|
+
data = _read_stable_file(path, root, max_file_bytes)
|
|
195
|
+
except EngineIdentityError:
|
|
196
|
+
raise
|
|
197
|
+
except OSError as exc:
|
|
198
|
+
raise EngineIdentityError("engine_file_unreadable") from exc
|
|
199
|
+
total_bytes += len(data)
|
|
200
|
+
if total_bytes > max_total_bytes:
|
|
201
|
+
raise EngineIdentityError("engine_total_too_large")
|
|
202
|
+
yield relative, data
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def engine_identity_and_files(
|
|
176
206
|
cache_version: str,
|
|
177
207
|
*,
|
|
178
208
|
package_root: Path | None = None,
|
|
@@ -181,8 +211,16 @@ def engine_identity(
|
|
|
181
211
|
max_files: int = MAX_ENGINE_FILES,
|
|
182
212
|
max_file_bytes: int = MAX_ENGINE_FILE_BYTES,
|
|
183
213
|
max_total_bytes: int = MAX_ENGINE_TOTAL_BYTES,
|
|
184
|
-
) -> dict[str, str]:
|
|
185
|
-
"""
|
|
214
|
+
) -> tuple[dict[str, str], dict[str, str]]:
|
|
215
|
+
"""The engine's identity, and the inventory of the files it covers.
|
|
216
|
+
|
|
217
|
+
The fingerprint says THAT the engine changed; the inventory says WHICH file
|
|
218
|
+
changed. The fingerprint covers the PACKAGE directory, so a source edit
|
|
219
|
+
moves it without touching the repository being checked, while the
|
|
220
|
+
repository's file-level diff covers the REPOSITORY and so names nothing.
|
|
221
|
+
That asymmetry is why `check` reported `engine_changed` with empty
|
|
222
|
+
added/changed/removed lists and no actor -- the 1.7.0 gate hit exactly it.
|
|
223
|
+
"""
|
|
186
224
|
if isinstance(max_file_bytes, bool) or max_file_bytes <= 0:
|
|
187
225
|
raise EngineIdentityError("engine_file_too_large")
|
|
188
226
|
if isinstance(max_total_bytes, bool) or max_total_bytes <= 0:
|
|
@@ -207,7 +245,6 @@ def engine_identity(
|
|
|
207
245
|
root = candidate_root.resolve(strict=True)
|
|
208
246
|
except OSError as exc:
|
|
209
247
|
raise EngineIdentityError("engine_root_invalid") from exc
|
|
210
|
-
paths = _collect_engine_files(root, max_files=max_files)
|
|
211
248
|
|
|
212
249
|
header = {
|
|
213
250
|
"cache_version": cache_version,
|
|
@@ -217,22 +254,78 @@ def engine_identity(
|
|
|
217
254
|
}
|
|
218
255
|
digest = hashlib.sha256()
|
|
219
256
|
digest.update(json.dumps(header, sort_keys=True, separators=(",", ":")).encode("utf-8"))
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
except OSError as exc:
|
|
228
|
-
raise EngineIdentityError("engine_file_unreadable") from exc
|
|
229
|
-
total_bytes += len(data)
|
|
230
|
-
if total_bytes > max_total_bytes:
|
|
231
|
-
raise EngineIdentityError("engine_total_too_large")
|
|
257
|
+
files: dict[str, str] = {}
|
|
258
|
+
for relative, data in _read_engine_files(
|
|
259
|
+
root,
|
|
260
|
+
max_files=max_files,
|
|
261
|
+
max_file_bytes=max_file_bytes,
|
|
262
|
+
max_total_bytes=max_total_bytes,
|
|
263
|
+
):
|
|
232
264
|
encoded_name = relative.encode("utf-8")
|
|
233
265
|
digest.update(len(encoded_name).to_bytes(4, "big"))
|
|
234
266
|
digest.update(encoded_name)
|
|
235
267
|
digest.update(len(data).to_bytes(8, "big"))
|
|
236
268
|
digest.update(data)
|
|
269
|
+
files[relative] = hashlib.sha256(data).hexdigest()
|
|
270
|
+
|
|
271
|
+
return {**header, "fingerprint": digest.hexdigest()}, files
|
|
272
|
+
|
|
237
273
|
|
|
238
|
-
|
|
274
|
+
def engine_identity(
|
|
275
|
+
cache_version: str,
|
|
276
|
+
*,
|
|
277
|
+
package_root: Path | None = None,
|
|
278
|
+
parsers: str | None = None,
|
|
279
|
+
version: str | None = None,
|
|
280
|
+
max_files: int = MAX_ENGINE_FILES,
|
|
281
|
+
max_file_bytes: int = MAX_ENGINE_FILE_BYTES,
|
|
282
|
+
max_total_bytes: int = MAX_ENGINE_TOTAL_BYTES,
|
|
283
|
+
) -> dict[str, str]:
|
|
284
|
+
"""Return a public, path-free identity for trusted packaged engine files."""
|
|
285
|
+
identity, _ = engine_identity_and_files(
|
|
286
|
+
cache_version,
|
|
287
|
+
package_root=package_root,
|
|
288
|
+
parsers=parsers,
|
|
289
|
+
version=version,
|
|
290
|
+
max_files=max_files,
|
|
291
|
+
max_file_bytes=max_file_bytes,
|
|
292
|
+
max_total_bytes=max_total_bytes,
|
|
293
|
+
)
|
|
294
|
+
return identity
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
def engine_file_inventory(
|
|
298
|
+
package_root: Path | None = None,
|
|
299
|
+
*,
|
|
300
|
+
max_files: int = MAX_ENGINE_FILES,
|
|
301
|
+
max_file_bytes: int = MAX_ENGINE_FILE_BYTES,
|
|
302
|
+
max_total_bytes: int = MAX_ENGINE_TOTAL_BYTES,
|
|
303
|
+
) -> dict[str, str]:
|
|
304
|
+
"""The engine's own source files, keyed by path relative to the package
|
|
305
|
+
root and valued by the hash of their bytes.
|
|
306
|
+
|
|
307
|
+
The fingerprint says THAT the engine changed. This says WHICH file changed,
|
|
308
|
+
and it is the only thing that can: the fingerprint covers the PACKAGE
|
|
309
|
+
directory, so a source edit moves it without touching the repository being
|
|
310
|
+
checked, while the file-level diff covers the REPOSITORY and so names
|
|
311
|
+
nothing. That asymmetry is why `check` reported `engine_changed` with empty
|
|
312
|
+
added/changed/removed lists and no actor -- the 1.7.0 gate hit exactly it.
|
|
313
|
+
|
|
314
|
+
Keys are relative and carry no absolute path, so an inventory can be
|
|
315
|
+
recorded in the manifest and in a diagnostic without disclosing where the
|
|
316
|
+
engine is installed.
|
|
317
|
+
"""
|
|
318
|
+
candidate_root = package_root if package_root is not None else Path(__file__).parent
|
|
319
|
+
try:
|
|
320
|
+
root = candidate_root.resolve(strict=True)
|
|
321
|
+
except OSError as exc:
|
|
322
|
+
raise EngineIdentityError("engine_root_invalid") from exc
|
|
323
|
+
return {
|
|
324
|
+
relative: hashlib.sha256(data).hexdigest()
|
|
325
|
+
for relative, data in _read_engine_files(
|
|
326
|
+
root,
|
|
327
|
+
max_files=max_files,
|
|
328
|
+
max_file_bytes=max_file_bytes,
|
|
329
|
+
max_total_bytes=max_total_bytes,
|
|
330
|
+
)
|
|
331
|
+
}
|
|
@@ -6,7 +6,7 @@ from pathlib import Path
|
|
|
6
6
|
from typing import Any
|
|
7
7
|
|
|
8
8
|
from .config import Config
|
|
9
|
-
from .engine_identity import EngineIdentityError,
|
|
9
|
+
from .engine_identity import EngineIdentityError, engine_identity_and_files
|
|
10
10
|
from .ingest import collect_files
|
|
11
11
|
|
|
12
12
|
_DOCTOR_FILE_LIMIT = 10_000
|
|
@@ -62,6 +62,31 @@ def engine_identity_delta(previous: Any, current: dict[str, Any]) -> dict[str, A
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
|
|
65
|
+
def engine_file_diff(recorded: Any, current: dict[str, str]) -> dict[str, Any] | None:
|
|
66
|
+
"""Which of the engine's own files moved, when the manifest recorded them.
|
|
67
|
+
|
|
68
|
+
`engine_changed` says the engine moved and nothing else, and the
|
|
69
|
+
repository's added/changed/removed lists are empty BY CONSTRUCTION on that
|
|
70
|
+
path -- the file diff is never computed. So the actor stayed unnamed: the
|
|
71
|
+
1.7.0 pre-push gate reported `engine_changed` on two tests in two workers
|
|
72
|
+
and could say nothing about what had moved.
|
|
73
|
+
|
|
74
|
+
The manifest records the engine's file inventory, so the difference names
|
|
75
|
+
the file. `None` means the question cannot be answered -- a manifest
|
|
76
|
+
written before the inventory was recorded -- and it is reported as absent
|
|
77
|
+
rather than as "nothing changed", which would be a different and false
|
|
78
|
+
claim.
|
|
79
|
+
"""
|
|
80
|
+
if not isinstance(recorded, dict) or not recorded:
|
|
81
|
+
return None
|
|
82
|
+
added = sorted(set(current) - set(recorded))
|
|
83
|
+
removed = sorted(set(recorded) - set(current))
|
|
84
|
+
changed = sorted(
|
|
85
|
+
name for name in set(current) & set(recorded) if current[name] != recorded[name]
|
|
86
|
+
)
|
|
87
|
+
return {"added": added, "changed": changed, "removed": removed}
|
|
88
|
+
|
|
89
|
+
|
|
65
90
|
def graph_engine_changed(cfg: Config, current_engine: dict[str, Any]) -> bool:
|
|
66
91
|
"""True when a built graph records an engine identity other than the current one.
|
|
67
92
|
|
|
@@ -127,7 +152,7 @@ def check_graph_freshness(
|
|
|
127
152
|
raise FreshnessLimitError("freshness file limit exceeded")
|
|
128
153
|
if not ignore_engine:
|
|
129
154
|
try:
|
|
130
|
-
current_engine =
|
|
155
|
+
current_engine, current_files = engine_identity_and_files(cfg.cache_version)
|
|
131
156
|
except EngineIdentityError:
|
|
132
157
|
return {
|
|
133
158
|
"stale": True,
|
|
@@ -141,6 +166,7 @@ def check_graph_freshness(
|
|
|
141
166
|
"stale": True,
|
|
142
167
|
"reason": "engine_changed",
|
|
143
168
|
"engine_delta": engine_identity_delta(previous.get("engine"), current_engine),
|
|
169
|
+
"engine_files": engine_file_diff(previous.get("engine_files"), current_files),
|
|
144
170
|
"added": [],
|
|
145
171
|
"changed": [],
|
|
146
172
|
"removed": [],
|
|
@@ -90,12 +90,16 @@ def test_build_partitions_the_cache_by_engine_fingerprint(
|
|
|
90
90
|
def _partitions() -> list[str]:
|
|
91
91
|
return sorted(p.name for p in cache_dir.iterdir() if p.is_dir())
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
# The build computes the identity and the engine's file inventory in ONE
|
|
94
|
+
# pass, so the seam it goes through yields both. The subject of this test
|
|
95
|
+
# is unchanged -- the fingerprint still decides the partition -- but the
|
|
96
|
+
# name the build goes through is the one that now carries it.
|
|
97
|
+
monkeypatch.setattr(cli, "engine_identity_and_files", lambda _v: (_engine("a" * 64), {}))
|
|
94
98
|
assert cli.main(["build", "."]) == 0
|
|
95
99
|
first = _partitions()
|
|
96
100
|
|
|
97
101
|
# Same repo, same cache_version, different engine. Nothing else changes.
|
|
98
|
-
monkeypatch.setattr(cli, "
|
|
102
|
+
monkeypatch.setattr(cli, "engine_identity_and_files", lambda _v: (_engine("b" * 64), {}))
|
|
99
103
|
assert cli.main(["build", "."]) == 0
|
|
100
104
|
second = _partitions()
|
|
101
105
|
|
|
@@ -9,7 +9,7 @@ import pytest
|
|
|
9
9
|
import graphite.engine_identity as engine_identity_module
|
|
10
10
|
import graphite.freshness as freshness_module
|
|
11
11
|
from graphite.config import Config
|
|
12
|
-
from graphite.engine_identity import EngineIdentityError, engine_identity
|
|
12
|
+
from graphite.engine_identity import EngineIdentityError, engine_file_inventory, engine_identity
|
|
13
13
|
from graphite.freshness import check_graph_freshness
|
|
14
14
|
from graphite.ingest import collect_files
|
|
15
15
|
|
|
@@ -46,6 +46,37 @@ def test_engine_identity_changes_when_trusted_source_changes(tmp_path: Path) ->
|
|
|
46
46
|
assert after["fingerprint"] != before["fingerprint"]
|
|
47
47
|
|
|
48
48
|
|
|
49
|
+
def test_the_engine_file_inventory_names_the_files_and_their_bytes(tmp_path: Path) -> None:
|
|
50
|
+
"""The fingerprint says THAT the engine moved; this says WHICH file.
|
|
51
|
+
|
|
52
|
+
The fingerprint covers the engine's package directory, so a source edit
|
|
53
|
+
moves it without touching the repository being checked -- and the
|
|
54
|
+
repository's file diff covers the repository, so it names nothing. That
|
|
55
|
+
asymmetry is why the 1.7.0 gate reported `engine_changed` with empty
|
|
56
|
+
file lists and no actor.
|
|
57
|
+
"""
|
|
58
|
+
package = _package(tmp_path)
|
|
59
|
+
|
|
60
|
+
inventory = engine_file_inventory(package_root=package)
|
|
61
|
+
|
|
62
|
+
assert set(inventory) == {"__init__.py", "resolver.mjs"}
|
|
63
|
+
assert all(len(digest) == 64 for digest in inventory.values())
|
|
64
|
+
# Keys are relative: an inventory is recorded in a manifest, and a
|
|
65
|
+
# manifest is read by whoever holds it.
|
|
66
|
+
assert all(not name.startswith(("/", "\\")) for name in inventory)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def test_the_engine_file_inventory_follows_the_bytes_of_one_file(tmp_path: Path) -> None:
|
|
70
|
+
package = _package(tmp_path)
|
|
71
|
+
inventory = engine_file_inventory(package_root=package)
|
|
72
|
+
|
|
73
|
+
(package / "__init__.py").write_text("VALUE = 2\n", encoding="utf-8")
|
|
74
|
+
after = engine_file_inventory(package_root=package)
|
|
75
|
+
|
|
76
|
+
assert after["__init__.py"] != inventory["__init__.py"]
|
|
77
|
+
assert after["resolver.mjs"] == inventory["resolver.mjs"]
|
|
78
|
+
|
|
79
|
+
|
|
49
80
|
def test_engine_identity_is_independent_of_inventory_order(tmp_path: Path, monkeypatch) -> None:
|
|
50
81
|
package = _package(tmp_path)
|
|
51
82
|
paths = engine_identity_module._collect_engine_files(package, max_files=512)
|
|
@@ -217,6 +248,9 @@ def test_freshness_treats_legacy_manifest_as_engine_changed(tmp_path: Path) -> N
|
|
|
217
248
|
"previous": None,
|
|
218
249
|
"current": current,
|
|
219
250
|
},
|
|
251
|
+
# No inventory was recorded either, so no file can be named -- and
|
|
252
|
+
# that is reported as absent rather than as "nothing changed".
|
|
253
|
+
"engine_files": None,
|
|
220
254
|
"added": [],
|
|
221
255
|
"changed": [],
|
|
222
256
|
"removed": [],
|
|
@@ -251,13 +285,16 @@ def test_freshness_prioritizes_engine_mismatch_when_repository_is_unchanged(
|
|
|
251
285
|
)
|
|
252
286
|
monkeypatch.setattr(
|
|
253
287
|
freshness_module,
|
|
254
|
-
"
|
|
255
|
-
lambda _cache_version:
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
288
|
+
"engine_identity_and_files",
|
|
289
|
+
lambda _cache_version: (
|
|
290
|
+
{
|
|
291
|
+
"version": "new",
|
|
292
|
+
"cache_version": cfg.cache_version,
|
|
293
|
+
"schema_version": "1",
|
|
294
|
+
"fingerprint": "1" * 64,
|
|
295
|
+
},
|
|
296
|
+
{},
|
|
297
|
+
),
|
|
261
298
|
)
|
|
262
299
|
|
|
263
300
|
result = check_graph_freshness(root, cfg)
|
|
@@ -270,6 +307,7 @@ def test_freshness_prioritizes_engine_mismatch_when_repository_is_unchanged(
|
|
|
270
307
|
"previous": {"fingerprint": "0" * 64, "version": "old"},
|
|
271
308
|
"current": {"fingerprint": "1" * 64, "version": "new"},
|
|
272
309
|
},
|
|
310
|
+
"engine_files": None,
|
|
273
311
|
"added": [],
|
|
274
312
|
"changed": [],
|
|
275
313
|
"removed": [],
|
|
@@ -306,7 +344,9 @@ def test_freshness_names_the_part_of_the_engine_that_moved(tmp_path: Path, monke
|
|
|
306
344
|
"fingerprint": "a" * 64,
|
|
307
345
|
}
|
|
308
346
|
_seed_engine(root, output, {**current, "version": "1.0.0"})
|
|
309
|
-
monkeypatch.setattr(
|
|
347
|
+
monkeypatch.setattr(
|
|
348
|
+
freshness_module, "engine_identity_and_files", lambda _cache_version: (current, {})
|
|
349
|
+
)
|
|
310
350
|
|
|
311
351
|
result = check_graph_freshness(root, cfg)
|
|
312
352
|
|
|
@@ -331,7 +371,9 @@ def test_freshness_carries_no_engine_delta_when_the_engine_did_not_move(tmp_path
|
|
|
331
371
|
"fingerprint": "a" * 64,
|
|
332
372
|
}
|
|
333
373
|
_seed_engine(root, output, current)
|
|
334
|
-
monkeypatch.setattr(
|
|
374
|
+
monkeypatch.setattr(
|
|
375
|
+
freshness_module, "engine_identity_and_files", lambda _cache_version: (current, {})
|
|
376
|
+
)
|
|
335
377
|
|
|
336
378
|
result = check_graph_freshness(root, cfg)
|
|
337
379
|
|
|
@@ -824,6 +824,111 @@ def test_check_json_names_the_part_of_the_engine_that_moved(tmp_path: Path, monk
|
|
|
824
824
|
assert payload["engine_delta"]["current"] == {"version": real_version}
|
|
825
825
|
|
|
826
826
|
|
|
827
|
+
def _tamper_a_recorded_engine_file(tmp_path: Path, name: str) -> None:
|
|
828
|
+
"""Make the manifest's record of ONE engine file differ from the engine.
|
|
829
|
+
|
|
830
|
+
This is the state a real edit leaves behind: the manifest holds the hash
|
|
831
|
+
the file had when the graph was built, and the file on disk holds the hash
|
|
832
|
+
it has now. The recorded identity is downgraded separately, so the check
|
|
833
|
+
reaches the engine-changed path at all.
|
|
834
|
+
"""
|
|
835
|
+
manifest_path = tmp_path / "graph-out" / ".graphite_manifest.json"
|
|
836
|
+
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
|
|
837
|
+
recorded = dict(manifest["engine_files"])
|
|
838
|
+
recorded[name] = "0" * 64
|
|
839
|
+
manifest["engine_files"] = recorded
|
|
840
|
+
manifest_path.write_text(json.dumps(manifest), encoding="utf-8")
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
def test_check_names_the_engine_file_that_moved(tmp_path: Path, monkeypatch, capsys) -> None:
|
|
844
|
+
"""The actor, named.
|
|
845
|
+
|
|
846
|
+
`engine_changed` said the engine moved and listed no files: the
|
|
847
|
+
repository's diff covers the repository, and the fingerprint covers the
|
|
848
|
+
engine's own package directory, so the file that moved was in neither.
|
|
849
|
+
The 1.7.0 pre-push gate hit exactly this and could say nothing about what
|
|
850
|
+
had moved.
|
|
851
|
+
"""
|
|
852
|
+
_write(tmp_path / "src" / "app.ts", "export const app = 1;\n")
|
|
853
|
+
monkeypatch.chdir(tmp_path)
|
|
854
|
+
assert main(["build", "."]) == 0
|
|
855
|
+
capsys.readouterr()
|
|
856
|
+
_downgrade_the_recorded_engine_version(tmp_path)
|
|
857
|
+
_tamper_a_recorded_engine_file(tmp_path, "engine_identity.py")
|
|
858
|
+
|
|
859
|
+
assert main(["check", ".", "--json"]) == 1
|
|
860
|
+
payload = json.loads(capsys.readouterr().out)
|
|
861
|
+
|
|
862
|
+
assert payload["reason"] == "engine_changed"
|
|
863
|
+
assert payload["engine_files"]["changed"] == ["engine_identity.py"]
|
|
864
|
+
assert payload["engine_files"]["added"] == []
|
|
865
|
+
assert payload["engine_files"]["removed"] == []
|
|
866
|
+
# The repository's own lists stay empty -- the file that moved is not in
|
|
867
|
+
# the repository, which is the whole reason the actor was unnameable.
|
|
868
|
+
assert payload["changed"] == []
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
def test_check_reports_no_moved_engine_file_when_the_inventory_agrees(
|
|
872
|
+
tmp_path: Path, monkeypatch, capsys
|
|
873
|
+
) -> None:
|
|
874
|
+
"""The falsifiability guard for the test above.
|
|
875
|
+
|
|
876
|
+
The diff is not always non-empty: with the inventory in agreement, the
|
|
877
|
+
engine has still moved and no file is named.
|
|
878
|
+
"""
|
|
879
|
+
_write(tmp_path / "src" / "app.ts", "export const app = 1;\n")
|
|
880
|
+
monkeypatch.chdir(tmp_path)
|
|
881
|
+
assert main(["build", "."]) == 0
|
|
882
|
+
capsys.readouterr()
|
|
883
|
+
_downgrade_the_recorded_engine_version(tmp_path)
|
|
884
|
+
|
|
885
|
+
assert main(["check", ".", "--json"]) == 1
|
|
886
|
+
payload = json.loads(capsys.readouterr().out)
|
|
887
|
+
|
|
888
|
+
assert payload["reason"] == "engine_changed"
|
|
889
|
+
assert payload["engine_files"] == {"added": [], "changed": [], "removed": []}
|
|
890
|
+
|
|
891
|
+
|
|
892
|
+
def test_check_reports_an_absent_inventory_rather_than_an_empty_one(
|
|
893
|
+
tmp_path: Path, monkeypatch, capsys
|
|
894
|
+
) -> None:
|
|
895
|
+
"""A manifest written before the inventory was recorded cannot answer.
|
|
896
|
+
|
|
897
|
+
"No file changed" and "we do not know" are different claims, and only the
|
|
898
|
+
second one is true here.
|
|
899
|
+
"""
|
|
900
|
+
_write(tmp_path / "src" / "app.ts", "export const app = 1;\n")
|
|
901
|
+
monkeypatch.chdir(tmp_path)
|
|
902
|
+
assert main(["build", "."]) == 0
|
|
903
|
+
capsys.readouterr()
|
|
904
|
+
_downgrade_the_recorded_engine_version(tmp_path)
|
|
905
|
+
manifest_path = tmp_path / "graph-out" / ".graphite_manifest.json"
|
|
906
|
+
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
|
|
907
|
+
manifest.pop("engine_files")
|
|
908
|
+
manifest_path.write_text(json.dumps(manifest), encoding="utf-8")
|
|
909
|
+
|
|
910
|
+
assert main(["check", ".", "--json"]) == 1
|
|
911
|
+
payload = json.loads(capsys.readouterr().out)
|
|
912
|
+
|
|
913
|
+
assert payload["reason"] == "engine_changed"
|
|
914
|
+
assert payload["engine_files"] is None
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
def test_the_manifest_records_the_engine_file_inventory(tmp_path: Path, monkeypatch) -> None:
|
|
918
|
+
"""Without a recorded inventory there is nothing to diff against."""
|
|
919
|
+
_write(tmp_path / "src" / "app.ts", "export const app = 1;\n")
|
|
920
|
+
monkeypatch.chdir(tmp_path)
|
|
921
|
+
assert main(["build", "."]) == 0
|
|
922
|
+
|
|
923
|
+
manifest_path = tmp_path / "graph-out" / ".graphite_manifest.json"
|
|
924
|
+
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
|
|
925
|
+
inventory = manifest["engine_files"]
|
|
926
|
+
|
|
927
|
+
assert "engine_identity.py" in inventory
|
|
928
|
+
assert all(not name.startswith(("/", "\\")) for name in inventory)
|
|
929
|
+
assert all(len(digest) == 64 for digest in inventory.values())
|
|
930
|
+
|
|
931
|
+
|
|
827
932
|
def test_check_names_the_part_of_the_engine_that_moved_without_json(tmp_path: Path, monkeypatch, capsys) -> None:
|
|
828
933
|
"""The short form says it too: which part, and what it moved from and to."""
|
|
829
934
|
_write(tmp_path / "src" / "app.ts", "export const app = 1;\n")
|
|
@@ -151,3 +151,8 @@ def test_build_manifest_records_engine_identity(tmp_path: Path, monkeypatch, cap
|
|
|
151
151
|
# into engine_identity's return value (#52).
|
|
152
152
|
assert "tree-sitter-python=" in manifest["engine"]["parsers"]
|
|
153
153
|
assert_json_omits(Path(__file__).parents[1], manifest["engine"])
|
|
154
|
+
# The engine's file inventory is recorded beside the identity, so that a
|
|
155
|
+
# later `check` can name the file that moved. It is relative for the same
|
|
156
|
+
# reason the identity is path-free: a manifest is read by whoever holds it.
|
|
157
|
+
assert manifest["engine_files"]
|
|
158
|
+
assert_json_omits(Path(__file__).parents[1], manifest["engine_files"])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|