From 4b46bd326bca6f2220a304c9832365b73748d545 Mon Sep 17 00:00:00 2001 From: Anthony Printup <92564080+anthonyprintup@users.noreply.github.com> Date: Sun, 4 Oct 2026 15:34:00 +0200 Subject: [PATCH 01/12] fix(cmake): preserve nested pip-bootstrap diagnostics Run venv through a small wrapper that catches bootstrap subprocess failures before the standard CLI discards their captured output. Preserve the selected interpreter, isolation, platform defaults, timeout, and existing rollback path. Redact URLs before truncation, remove control characters, bound each captured stream to 16,384 characters, and report the original child exit status without printing the child command or environment. Install the helper with the CMake package, document the diagnostic behavior, and cover real nested child failures, missing modules, rollback refusal, credential redaction, and successful environment creation. Extend the Windows Python 3.12-3.14 CI matrix with the new regressions. Validated focused tests on Windows with Python 3.12 and 3.14, normal and relocated-install provisioning, transaction/documentation tests, Ruff, and the private-path guard. Fixes #51 --- .github/workflows/cmake-integration.yml | 4 +- CMakeLists.txt | 1 + cmake/ProtocyteCreateEnvironment.py | 61 +++++++++++ cmake/ProtocyteFunctions.cmake | 16 ++- docs/wiki/Troubleshooting.md | 9 ++ tests/test_cmake.py | 128 ++++++++++++++++++++++++ tests/test_create_environment.py | 128 ++++++++++++++++++++++++ 7 files changed, 343 insertions(+), 4 deletions(-) create mode 100644 cmake/ProtocyteCreateEnvironment.py create mode 100644 tests/test_create_environment.py diff --git a/.github/workflows/cmake-integration.yml b/.github/workflows/cmake-integration.yml index 2bfba5d..86b9309 100644 --- a/.github/workflows/cmake-integration.yml +++ b/.github/workflows/cmake-integration.yml @@ -48,7 +48,9 @@ jobs: - name: Verify managed provisioning, nested reuse, and diagnostics run: > - uv run pytest -q -m cmake_integration + uv run pytest -q -o "addopts=" + tests/test_create_environment.py + tests/test_cmake.py::test_managed_environment_preserves_bootstrap_failure_and_rolls_back tests/test_cmake.py::test_managed_host_tools_support_nested_reuse_and_stage_specific_diagnostics fetchcontent-linux: diff --git a/CMakeLists.txt b/CMakeLists.txt index dc3518e..a5f66b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,6 +178,7 @@ if(PROTOCYTE_INSTALL) "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteFunctions.cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteProcess.cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteManagedEnvironment.py" + "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteCreateEnvironment.py" "${CMAKE_CURRENT_LIST_DIR}/.github/scripts/owned_transactions.py" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteOutputSafety.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake/protocyteConfig.cmake" diff --git a/cmake/ProtocyteCreateEnvironment.py b/cmake/ProtocyteCreateEnvironment.py new file mode 100644 index 0000000..eaff04a --- /dev/null +++ b/cmake/ProtocyteCreateEnvironment.py @@ -0,0 +1,61 @@ +"""Run venv's CLI entry point without discarding pip-bootstrap diagnostics. + +CMake invokes this with the selected host Python and -I, and owns the timeout +and transaction rollback. Keep venv's platform/version defaults in one place. +""" + +from __future__ import annotations + +import re +import subprocess +import sys + + +_MAX_DIAGNOSTIC_CHARS = 16 * 1024 +_URL = re.compile(r"\b[a-z][a-z0-9+.-]*://\S+", re.IGNORECASE) +_TRUNCATION = "\n[... bootstrap diagnostic truncated ...]\n" + + +def _diagnostic(value: bytes | str | None) -> str: + if value is None: + return "" + text = ( + value.decode("utf-8", errors="replace") if isinstance(value, bytes) else value + ) + text = text.replace("\r\n", "\n").replace("\r", "\n") + # Redact whole URLs, including path/query tokens, before truncating so a + # boundary cannot expose a credential. Never print the child command or env. + text = _URL.sub("", text) + text = "".join(c if c.isprintable() or c in "\n\t" else "?" for c in text) + if len(text) > _MAX_DIAGNOSTIC_CHARS: + head = (_MAX_DIAGNOSTIC_CHARS - len(_TRUNCATION)) // 2 + tail = _MAX_DIAGNOSTIC_CHARS - len(_TRUNCATION) - head + text = text[:head] + _TRUNCATION + text[-tail:] + return text + + +def main() -> int: + try: + import venv + + # venv.__main__ catches this exception and prints only str(error), + # losing the output captured by EnvBuilder._call_new_python. + venv.main() + except subprocess.CalledProcessError as error: + print( + f"Python environment bootstrap subprocess failed (exit code {error.returncode}).", + file=sys.stderr, + ) + print(_diagnostic(error.output), file=sys.stderr) + if error.stderr is not None: + print(_diagnostic(error.stderr), file=sys.stderr) + return error.returncode if error.returncode > 0 else 1 + except Exception as error: + print(_diagnostic(f"{type(error).__name__}: {error}"), file=sys.stderr) + return 1 + return 0 + + +if __name__ == "__main__": + sys.stderr.reconfigure(errors="backslashreplace") + sys.exit(main()) diff --git a/cmake/ProtocyteFunctions.cmake b/cmake/ProtocyteFunctions.cmake index c5df376..2622863 100644 --- a/cmake/ProtocyteFunctions.cmake +++ b/cmake/ProtocyteFunctions.cmake @@ -10,6 +10,11 @@ set_property( PROPERTY PROTOCYTE_INTERNAL_MANAGED_ENVIRONMENT_HELPER "${CMAKE_CURRENT_LIST_DIR}/ProtocyteManagedEnvironment.py" ) +set_property( + GLOBAL + PROPERTY PROTOCYTE_INTERNAL_CREATE_ENVIRONMENT_HELPER + "${CMAKE_CURRENT_LIST_DIR}/ProtocyteCreateEnvironment.py" +) function(_protocyte_configure_python_environment_root) if(NOT DEFINED PROTOCYTE_PYTHON_ENV_ROOT OR "${PROTOCYTE_PYTHON_ENV_ROOT}" STREQUAL "") @@ -2561,7 +2566,12 @@ function(_protocyte_ensure_python_environment out_python out_plugin) else() set(protocyte_disabled_pip_config "/dev/null") endif() - set(venv_arguments -m venv "${protocyte_python_staging}") + get_property( + protocyte_create_environment_helper + GLOBAL + PROPERTY PROTOCYTE_INTERNAL_CREATE_ENVIRONMENT_HELPER + ) + set(venv_arguments -I "${protocyte_create_environment_helper}" "${protocyte_python_staging}") execute_process( COMMAND "${CMAKE_COMMAND}" -E env @@ -2580,7 +2590,7 @@ function(_protocyte_ensure_python_environment out_python out_plugin) "--unset=PYTHONHOME" "PIP_ISOLATED=0" "PIP_CONFIG_FILE=${protocyte_disabled_pip_config}" - "${Python3_EXECUTABLE}" -I ${venv_arguments} + "${Python3_EXECUTABLE}" ${venv_arguments} RESULT_VARIABLE venv_result OUTPUT_VARIABLE venv_output ERROR_VARIABLE venv_error @@ -2600,7 +2610,7 @@ function(_protocyte_ensure_python_environment out_python out_plugin) string(APPEND venv_error "\nFailed to restore the previous environment: ${rollback_output}") endif() _protocyte_python_provisioning_error( - "create the virtual environment; ensure the selected Python provides venv and ensurepip" + "create the virtual environment and bootstrap pip" "\"${Python3_EXECUTABLE}\" ${venv_command}" "${venv_result}" "${venv_output}" diff --git a/docs/wiki/Troubleshooting.md b/docs/wiki/Troubleshooting.md index 3272f1e..830d902 100644 --- a/docs/wiki/Troubleshooting.md +++ b/docs/wiki/Troubleshooting.md @@ -22,6 +22,15 @@ An interpreter without `venv` or `ensurepip` cannot provision Protocyte's manage ## Managed Python Provisioning Fails +If virtual-environment creation or pip bootstrapping fails, the CMake error +includes the failing stage, selected interpreter, managed paths, and captured +child-process diagnostics. Bootstrap diagnostics redact URLs and retain up to +16,384 characters per stream, keeping both the beginning and end of longer +output. A subprocess failure alone does not mean `venv` or `ensurepip` is missing; +look for an explicit missing-module error or the underlying child failure. +Protocyte attempts rollback before reporting the error; any rollback failure is +reported alongside the original diagnostic, preserving unverified environments. + Check: - the selected interpreter can create virtual environments; diff --git a/tests/test_cmake.py b/tests/test_cmake.py index 1ad6015..adfd97d 100644 --- a/tests/test_cmake.py +++ b/tests/test_cmake.py @@ -3565,6 +3565,7 @@ def test_fetchcontent_can_explicitly_enable_protocyte_install( assert any(prefix.rglob("ProtocyteGenerate.cmake")) assert any(prefix.rglob("ProtocyteProcess.cmake")) assert any(prefix.rglob("ProtocyteManagedEnvironment.py")) + assert any(prefix.rglob("ProtocyteCreateEnvironment.py")) assert any(prefix.rglob("owned_transactions.py")) assert (prefix / "share/protocyte/python/pyproject.toml").is_file() @@ -13092,6 +13093,133 @@ def test_cmake_fingerprint_inputs_trigger_automatic_reconfiguration( assert updated_fingerprint != initial_fingerprint +@pytest.mark.parametrize("failure", ["nested-child", "missing-ensurepip"]) +@pytest.mark.parametrize("existing_environment", [False, True]) +def test_managed_environment_preserves_bootstrap_failure_and_rolls_back( + tmp_path: Path, failure: str, existing_environment: bool +) -> None: + repo_root = Path(__file__).resolve().parents[1] + helper = repo_root / "cmake/ProtocyteCreateEnvironment.py" + driver = tmp_path / "injected-bootstrap.py" + if failure == "nested-child": + child_code = ( + "import os, sys; " + "print('SYNTHETIC_' + 'BOOTSTRAP_' + 'FAILURE_12345', flush=True); " + "print(os.environ['PIP_INDEX_URL'], flush=True); " + "print('noise' * 5000, flush=True); " + "print('nested stderr detail', file=sys.stderr); sys.exit(17)" + ) + else: + child_code = ( + "import sys, importlib.abc; " + 'exec("class MissingEnsurepip(importlib.abc.MetaPathFinder):\\n' + " def find_spec(self, fullname, *args):\\n" + " if fullname == 'ensurepip':\\n" + ' raise ModuleNotFoundError(\\"No module named \'ensurepip\'\\", name=fullname)"); ' + "sys.meta_path.insert(0, MissingEnsurepip()); import ensurepip" + ) + driver.write_text( + "\n".join( + [ + "import os, runpy, subprocess, sys, venv", + "assert sys.flags.isolated", + "assert not any(name in os.environ for name in " + "('PIP_TARGET', 'PIP_PREFIX', 'PIP_ROOT', 'PIP_USER', 'PYTHONUSERBASE'))", + "class InjectedBuilder(venv.EnvBuilder):", + " def _setup_pip(self, context):", + " self._call_new_python(context, '-I', '-c', " + f"{child_code!r}, stderr=subprocess.STDOUT)", + "venv.EnvBuilder = InjectedBuilder", + f"runpy.run_path({str(helper)!r}, run_name='__main__')", + "", + ] + ), + encoding="utf-8", + ) + environment_root = tmp_path / "managed-environments" + source_dir = tmp_path / "consumer" + build_dir = _write_managed_environment_consumer(source_dir, environment_root) + cmake_file = source_dir / "CMakeLists.txt" + cmake_file.write_text( + cmake_file.read_text(encoding="utf-8").replace( + "protocyte_get_host_tools(", + "\n".join( + [ + "set_property(GLOBAL PROPERTY PROTOCYTE_INTERNAL_CREATE_ENVIRONMENT_HELPER", + f' "{driver.as_posix()}")', + "find_package(Python3 3.12 COMPONENTS Interpreter REQUIRED)", + "_protocyte_python_environment_fingerprint(fingerprint", + ' "${PROTOCYTE_PYTHON_PROJECT_ROOT}" "${PROTOCYTE_PYTHON_CONSTRAINTS}"', + ' "${Python3_EXECUTABLE}" "${Python3_VERSION}")', + 'string(SUBSTRING "${fingerprint}" 0 16 short_fingerprint)', + 'set(previous "${PROTOCYTE_PYTHON_ENV_ROOT}/${short_fingerprint}")', + f"if({'TRUE' if existing_environment else 'FALSE'})", + ' file(MAKE_DIRECTORY "${previous}")', + ' file(WRITE "${previous}/.protocyte-ready" "${fingerprint}\\n")', + ' file(WRITE "${previous}/retained.txt" "previous environment\\n")', + "endif()", + "protocyte_get_host_tools(", + ] + ), + ), + encoding="utf-8", + ) + environment = _managed_environment_process_environment() + environment.update( + PIP_NO_INDEX="1", + PIP_INDEX_URL="https://test-user:private-password@example.invalid/private-path?key=private-query", + PROTOCYTE_TRANSACTION_STATE_DIR=str(tmp_path / "transaction-state"), + PIP_TARGET=str(tmp_path / "forbidden-target"), + PIP_PREFIX=str(tmp_path / "forbidden-prefix"), + PIP_ROOT=str(tmp_path / "forbidden-root"), + PIP_USER="1", + PYTHONUSERBASE=str(tmp_path / "forbidden-user-base"), + ) + result = _configure_managed_environment(source_dir, build_dir, env=environment) + output = result.stdout + result.stderr + assert result.returncode != 0 + assert "create the virtual environment and bootstrap pip" in " ".join( + output.split() + ) + if failure == "nested-child": + assert "Exit code: 17" in output + assert "SYNTHETIC_BOOTSTRAP_FAILURE_12345" in output + assert "nested stderr detail" in output + assert "bootstrap diagnostic truncated" in output + assert "" in output + assert "No module named" not in output + for secret in ( + "private-password", + "private-path", + "private-query", + "example.invalid", + ): + assert secret not in output + else: + assert "Exit code: 1" in output + assert "No module named 'ensurepip'" in output + assert "SYNTHETIC_BOOTSTRAP_FAILURE_12345" not in output + assert len(output) < 24 * 1024 + if existing_environment: + # An unverified destination cannot be overwritten by rollback. Both + # that refusal and the original bootstrap failure must remain visible. + assert "Failed to restore the previous environment" in output + assert "refusing to restore over an unverified" in output + previous = _published_managed_environment(environment_root) + assert (previous / "retained.txt").read_text( + encoding="utf-8" + ) == "previous environment\n" + assert {path.name for path in previous.iterdir()} == { + ".protocyte-ready", + "retained.txt", + } + else: + assert "Failed to restore the previous environment" not in output + assert not any(path.is_dir() for path in environment_root.iterdir()) + _assert_no_managed_environment_transaction_leftovers(environment_root) + assert not list(tmp_path.glob("forbidden-*")) + + def test_cmake_provisioning_error_reports_the_failed_command(tmp_path: Path) -> None: repo_root = Path(__file__).resolve().parents[1] cmake_script = tmp_path / "provisioning_error.cmake" diff --git a/tests/test_create_environment.py b/tests/test_create_environment.py new file mode 100644 index 0000000..22c9ee8 --- /dev/null +++ b/tests/test_create_environment.py @@ -0,0 +1,128 @@ +import builtins +import importlib.util +import os +import subprocess +import sys +import venv +from pathlib import Path + +import pytest + + +_HELPER = Path(__file__).resolve().parents[1] / "cmake/ProtocyteCreateEnvironment.py" +_SPEC = importlib.util.spec_from_file_location("protocyte_create_environment", _HELPER) +assert _SPEC is not None and _SPEC.loader is not None +bootstrap = importlib.util.module_from_spec(_SPEC) +_SPEC.loader.exec_module(bootstrap) + + +@pytest.mark.parametrize("as_bytes", [False, True]) +def test_bootstrap_diagnostics_are_sanitized_and_bounded( + monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str], as_bytes: bool +) -> None: + output = ( + "first diagnostic\n" + "https://user:password@example.invalid/private-token?key=query-secret\n" + "https://user:quoted'password@example.invalid/index\n" + "https://example.invalid/" + + "token" * 5000 + + "\n" + + "noise\n" * 5000 + + "last diagnostic\n" + ) + error_output = "stderr detail\nHTTPS://other:secret@example.invalid/index\n\x1b\x00" + + def fail() -> None: + raise subprocess.CalledProcessError( + 17, + ["command-must-not-leak"], + output=output.encode() if as_bytes else output, + stderr=error_output.encode() + b"\xff" if as_bytes else error_output, + ) + + monkeypatch.setattr(venv, "main", fail) + assert bootstrap.main() == 17 + captured = capsys.readouterr() + assert captured.out == "" + assert "exit code 17" in captured.err + assert "first diagnostic" in captured.err + assert "last diagnostic" in captured.err + assert "stderr detail" in captured.err + assert "bootstrap diagnostic truncated" in captured.err + assert "" in captured.err + assert len(captured.err) < 17 * 1024 + for private in ( + "password", + "quoted", + "private-token", + "query-secret", + "token", + "other:secret", + "example.invalid", + "command-must-not-leak", + "\x1b", + "\x00", + ): + assert private not in captured.err + + +def test_missing_venv_is_reported_separately( + monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str] +) -> None: + original_import = builtins.__import__ + + def without_venv(name, *args, **kwargs): + if name == "venv": + raise ModuleNotFoundError("No module named 'venv'", name="venv") + return original_import(name, *args, **kwargs) + + monkeypatch.setattr(builtins, "__import__", without_venv) + assert bootstrap.main() == 1 + captured = capsys.readouterr() + assert "ModuleNotFoundError: No module named 'venv'" in captured.err + assert "bootstrap subprocess failed" not in captured.err + + +def test_create_environment_preserves_venv_defaults(tmp_path: Path) -> None: + destination = tmp_path / "environment with spaces" + environment = os.environ.copy() + environment.update( + PIP_NO_INDEX="1", + PIP_CONFIG_FILE=os.devnull, + PYTHONHOME=str(tmp_path / "invalid-home"), + PYTHONPATH=str(tmp_path / "invalid-import-path"), + ) + result = subprocess.run( + [sys.executable, "-I", str(_HELPER), str(destination)], + check=False, + capture_output=True, + text=True, + env=environment, + timeout=120, + ) + assert result.returncode == 0, result.stdout + result.stderr + python = destination / ("Scripts/python.exe" if os.name == "nt" else "bin/python") + probe = subprocess.run( + [ + str(python), + "-I", + "-c", + "import pip, sys; print(sys.prefix); print(sys.base_prefix); print(pip.__file__)", + ], + check=True, + capture_output=True, + text=True, + env=environment, + timeout=30, + ) + prefix, base, pip_path = probe.stdout.splitlines() + assert Path(prefix).resolve() == destination.resolve() + assert Path(base).resolve() == Path(sys.base_prefix).resolve() + assert Path(pip_path).is_relative_to(destination) + assert "include-system-site-packages = false" in ( + destination / "pyvenv.cfg" + ).read_text(encoding="utf-8") + assert python.is_symlink() == (os.name != "nt") + assert (python.parent / "activate").is_file() + if sys.version_info >= (3, 13): + assert (destination / ".gitignore").is_file() From f804fd167e1f9c913f51b609c3d9fc14c0ef52ff Mon Sep 17 00:00:00 2001 From: Anthony Printup <92564080+anthonyprintup@users.noreply.github.com> Date: Mon, 16 Nov 2026 02:06:10 +0100 Subject: [PATCH 02/12] perf(cmake): reduce registry metadata work and retain progress - Replace repeated physical ancestor searches with comparison-local directory identity observations while retaining fresh projections and reverse checks. - Remove the progress reporter lifetime cap and duplicate projection existence searches without changing shared lock ordering or ownership persistence. - Isolate CMake test registries and add alias, replacement, depth and progress regressions. - Extend isolated scaling/profiling tools and preserve sanitized measurements, architecture analysis and the proposed indexed generation-engine design. Validation before this checkpoint: Python 3.14 unit suite 1724 passed/41 skipped; focused CMake suite 16 passed/1 skipped; Python 3.12.9 coordinator suite 87 passed/ 6 skipped. Ruff and git diff --check passed. The under-30-second indexed engine remains an explicitly unimplemented proposal at this checkpoint. --- cmake/ProtocyteOutputCoordinator.py | 81 +- docs/generation-engine-proposal.md | 234 ++ docs/registry-validation-30s-plan.md | 172 ++ docs/registry-validation-design.md | 139 ++ docs/registry-validation-feasibility.json | 57 + docs/registry-validation-refinements.md | 198 ++ docs/registry-validation-results.json | 2731 +++++++++++++++++++++ docs/registry-validation-results.md | 153 ++ docs/wiki/Contributing.md | 25 +- docs/wiki/Troubleshooting.md | 3 +- tests/benchmark_output_registry.py | 93 +- tests/conftest.py | 26 + tests/profile_output_registry.py | 132 + tests/registry_validation_poc.py | 261 ++ tests/test_output_coordinator.py | 195 +- tests/test_output_coordinator_cmake.py | 29 + 16 files changed, 4466 insertions(+), 63 deletions(-) create mode 100644 docs/generation-engine-proposal.md create mode 100644 docs/registry-validation-30s-plan.md create mode 100644 docs/registry-validation-design.md create mode 100644 docs/registry-validation-feasibility.json create mode 100644 docs/registry-validation-refinements.md create mode 100644 docs/registry-validation-results.json create mode 100644 docs/registry-validation-results.md create mode 100644 tests/conftest.py create mode 100644 tests/profile_output_registry.py create mode 100644 tests/registry_validation_poc.py diff --git a/cmake/ProtocyteOutputCoordinator.py b/cmake/ProtocyteOutputCoordinator.py index 25f1660..9b500f2 100644 --- a/cmake/ProtocyteOutputCoordinator.py +++ b/cmake/ProtocyteOutputCoordinator.py @@ -31,14 +31,13 @@ import time from dataclasses import dataclass from pathlib import Path, PurePosixPath -from typing import Any, Mapping, NoReturn, Sequence +from typing import Any, Iterator, Mapping, NoReturn, Sequence PROTOCOL_VERSION = 1 PLAN_HEADER = "protocyte-output-plan-v1" GENERATED_SUFFIXES = (".protocyte.cpp", ".protocyte.hpp", "/runtime.hpp") - class CoordinatorError(RuntimeError): """A fail-closed coordinator error suitable for a CMake diagnostic.""" @@ -92,27 +91,6 @@ def _require_absolute(path: Path, description: str) -> Path: return Path(os.path.normpath(text)) -def _existing_chain(path: Path) -> list[Path]: - current = path - missing: list[Path] = [] - while not os.path.lexists(current): - parent = current.parent - if parent == current: - _fail(f"could not find an existing ancestor for {path}") - missing.append(current) - current = parent - chain: list[Path] = [] - cursor = current - while True: - chain.append(cursor) - parent = cursor.parent - if parent == cursor: - break - cursor = parent - chain.reverse() - return chain - - def project_path(path: Path, *, leaf_may_be_file: bool = False) -> Path: """Resolve existing components and append a normalized missing suffix. @@ -130,7 +108,10 @@ def project_path(path: Path, *, leaf_may_be_file: bool = False) -> Path: _fail(f"could not project filesystem path: {path}") suffix.append(existing.name) existing = existing.parent - for component in _existing_chain(existing): + # Construct the chain without another existence search. Every component + # is still freshly checked, and the separate stat/strict resolve below + # retries if the initially existing leaf has disappeared. + for component in (*reversed(existing.parents), existing): if _is_link(component): _fail(f"filesystem path contains a symbolic link or junction: {path}") try: @@ -231,15 +212,41 @@ def _physically_contains(parent: Path, child: Path) -> bool: def _projected_physically_contains(parent: Path, child: Path) -> bool: parent_key = _physical_location_key(parent) - current = child + return parent_key in _physical_ancestor_keys(child) + + +def _physical_ancestor_keys(path: Path) -> Iterator[tuple[int, int, tuple[str, ...]]]: + """Observe ancestry once, only for this directional comparison. + + Missing descendants share their nearest existing directory's identity plus + a normalized suffix. Existing ordinary directories use the device/inode + relation used by samefile, without its two additional following stat calls. + No observations survive the comparison, including negative observations. + """ + current = path + missing: list[str] = [] while True: - if _same_physical_path(parent, current) or parent_key == _physical_location_key( - current - ): - return True + try: + observed = current.lstat() + except FileNotFoundError: + missing.append(current.name.casefold()) + except OSError as error: + _fail(f"could not identify physical filesystem location {path}: {error}") + else: + if _stat_is_link(observed): + _fail(f"filesystem path contains a symbolic link or junction: {path}") + if not stat.S_ISDIR(observed.st_mode): + _fail(f"filesystem path has a non-directory ancestor: {current}") + suffix = tuple(reversed(missing)) + for length in range(len(suffix), 0, -1): + yield observed.st_dev, observed.st_ino, suffix[:length] + missing.clear() + yield observed.st_dev, observed.st_ino, () next_parent = current.parent if next_parent == current: - return False + if missing: + _fail(f"could not identify physical filesystem location: {path}") + return current = next_parent @@ -541,15 +548,14 @@ def __exit__(self, *_: object) -> None: class _ReconcileProgress: - """Bounded, path-free stderr progress, including while OS locks block. + """Bounded-frequency, path-free stderr progress while work or locks block. - Fast operations stay silent. Long operations emit at most twelve progress - lines and one completion/failure summary. Nothing is written to the claim + Fast operations stay silent. Long operations report throughout their lifetime + and emit one completion/failure summary. Nothing is written to the claim token stream on stdout. The reporter observes counters only, not the FS. """ INTERVAL_SECONDS = 5.0 - MAX_REPORTS = 12 def __init__(self, current: int, retired: int) -> None: self.current = current @@ -607,13 +613,8 @@ def _emit(self, phase: str) -> None: def _report(self) -> bool: with self._mutex: - if self._reports >= self.MAX_REPORTS: - return False self._reports += 1 - phase = self._phase - if self._reports == self.MAX_REPORTS: - phase += " (further progress suppressed until completion)" - self._emit(phase) + self._emit(self._phase) return True def _run(self) -> None: diff --git a/docs/generation-engine-proposal.md b/docs/generation-engine-proposal.md new file mode 100644 index 0000000..7213411 --- /dev/null +++ b/docs/generation-engine-proposal.md @@ -0,0 +1,234 @@ +# A fast generation engine with simple integration + +## Recommendation and user contract + +Make planning, output ownership and publication a build-system-independent Python +engine. Keep CMake for packaging/exported C++ targets and as a thin, convenient +build adapter. Add a standalone CLI backed by the same engine. + +Ease of use is an acceptance criterion, not a later documentation task: + +- Existing consumers should keep their familiar `protocyte_add_proto_library`, + `protocyte_generate` and descriptor-set helper calls. +- Source/FetchContent users should configure and build without a separate global + plugin install or manual environment activation. +- Installed-prefix users should retain `find_package(protocyte CONFIG REQUIRED)` + and the current runtime targets, including read-only/relocatable prefixes. +- A standalone user should supply schemas and an output location, with managed + state/tool selection handled automatically. Configuration files are optional. +- Users should not select registry partitions, cache modes, lock strategies or + migration flags. Normal upgrades preserve ownership; conflicts remain explicit. + +The proposed standalone command is **new functionality**, not an existing command: + +```console +protocyte generate --proto-root proto --out-dir build/generated +``` + +The ordinary CMake call can remain: + +```cmake +protocyte_add_proto_library( + TARGET application_proto + PROTO_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/proto" + DISCOVER + HOSTED_ALLOCATOR +) +target_link_libraries(application PRIVATE application_proto) +``` + +The CLI may later have optional configuration for repeated complex arguments; +the basic case must not require users to author manifests or inventory files. +Python remains the current prerequisite. This design adds no native helper build, +service, database installation or extra process that users must manage. + +## Architecture and responsibilities + +```mermaid +flowchart LR + C[CMake adapter] --> E[Shared Python generation engine] + L[Standalone CLI] --> E + E --> P[Plan and dependency metadata] + E --> G[Host protoc and Protocyte plugin] + G --> T[Validated staging and transactional publication] + T --> O[Generated C++ outputs] +``` + +Suggested boundaries, introduced only as their contracts become clear: + +| Layer | Responsibility | +| --- | --- | +| Request/planning API | Normalize generation specs, reuse dependency/output naming logic, return task and dependency metadata | +| Record model | Decode/authenticate claims and plans, bind builds/targets, validate snapshots and transaction intent | +| Filesystem layer | Projection, aliases, ordinary-directory checks, missing components, physical identities and observation lifetime | +| Ownership index | All retained root/staging reservations, containment in both directions and existing ownership/retirement exceptions | +| Transaction engine | Locks, staging, durable intent, publication, retirement, recovery and reset | +| Adapters | Public arguments, C++ build targets, depfile/build metadata and presentation | + +Start with Python 3.12 and the existing standard-library-only coordinator code. +The generator already lives in the Python package; the coordinator can become +its build-engine subpackage without bringing protobuf-dependent imports into the +bootstrap/filesystem layer. Existing claims and write-ahead transactions remain +the initial storage/protocol format. A persistent database or daemon is not +necessary to test the indexed algorithm. + +Conceptual internal API: + +```python +prepared = engine.prepare(build_root, generation_specs) +engine.run(prepared.task(target_id)) +``` + +`prepare` batches declarations for the entire build and returns generated task +descriptions, outputs, dependency metadata and ownership binding. `run` performs +fresh task/claim validation, generation into staging and publication. Validation +and ownership-aware reset remain explicit internal entry points. + +Adapters create the task files automatically. They are versioned machine data, +not another configuration language for users. Requests must preserve Unicode, +spaces, semicolons and Windows path spellings without shell-command construction. +Keep the existing path transport until a replacement passes the transport tests. + +The public CLI should have a stable default build identity across invocations, +derived from its build scope rather than a new random owner every time. A build +directory override can be optional. The CMake adapter supplies its binary build +root as it does today. Different adapters must not silently adopt one another's +outputs merely because the requested directory matches. + +## How CMake becomes smaller + +CMake should declare C++ targets, configure dependency edges and invoke the engine. +At configure time it submits one batch of generation specs. At build time it +invokes one engine task for each generation job. The engine handles compiler +response files, staging, task validation and publication in one orchestration +process; the compiler/plugin remain subprocesses as required by their protocol. + +This replaces the current recursive CMake/Python generation wrapper chain. It +also gives other build systems access to the same safe pipeline. Dependency +discovery remains available before CMake must declare outputs, with correct +no-op builds, import-change detection and multi-config behavior. + +The current #52 behavior already batches registry reconciliation. The new adapter +must preserve that and must not call a full `prepare` separately for each target. +Moving orchestration out of CMake simplifies ownership and process flow, but it +does not itself solve the 750-second validation: the standalone Python POC +reproduces that cost without running CMake. + +Do not delete a CMake filesystem check just because similarly named Python code +exists. Map every current guard to its replacement boundary and keep the old +guard until the backend covers its safety contract and relevant race cases. + +## Packaging and tool provisioning + +The current CMake install already carries the Python project under +`share/protocyte/python`, alongside the installed CMake configuration and runtime +headers/targets. Reuse that model: + +- The Python wheel contains the engine, CLI, existing protoc plugin and runtime/ + schema data. Preserve `protoc-gen-protocyte`; add a separate `protocyte` entry + point so plugin stdin/stdout remains a binary protocol. +- FetchContent uses the checked-out Python sources. Installed-prefix consumption + uses the bundled Python project, selected explicitly from that prefix. +- The CMake coordinator launcher becomes a small compatibility entry point using + those exact sources. It must work before protobuf is installed, without finding + an unrelated globally installed package through the environment or working dir. +- Keep the existing managed-environment version/fingerprint checks and pinned + dependencies. Extend both source and installed generator-source dependency + lists to cover the new backend modules. +- Source and installed-package paths use the same engine version. A moved or + read-only package prefix must stay untouched; writable state belongs in the + consumer build/cache locations. + +Host tool resolution should be shared behind the interfaces. Ordinary supported +hosts can reuse supplied/compatible tools or acquire pinned, verified host tools +automatically where the integration allows it. Offline users and cross builds +keep explicit local host-tool overrides. Target compiler settings must not turn +`protoc` into an executable for the target platform. A new CLI should not need +CMake merely to orchestrate normal generation. + +## Performance design and safety boundary + +The algorithmic work belongs in the engine: + +1. Read and validate each immutable record once under the registry lock. +2. Separate record decoding/hashing from path-dependent authentication. +3. Observe distinct locations/components through an explicit validation context. +4. Build a transient index of all physical/lexical root and staging reservations. +5. Query that index for the current plans, and revalidate authority at the + required mutation boundaries. + +The desired metadata cost tracks unique paths/components and the required +validation passes, rather than retained claims multiplied by current plans. +See [the 30-second assessment](registry-validation-30s-plan.md) for measurements, +the authentication cost budget and the indexed algorithm's unresolved proof. + +This is not a general `Path.resolve` cache. An observation context must define +which names, directory identities and missing-component observations it relies +on; what makes them invalid; how it detects that; and what is freshly checked +before mutation. Registry locking does not freeze external topology, and two +matching metadata sweeps alone are not sufficient proof. In particular, validating +only the current output root does not protect a negative conflict result that +depends on a changed foreign path. + +Keep the existing shared registry, records, claim lifecycle and lock order for +the first implementation. Do not acquire registry while holding generation +locks: `prepare` finishes and releases its locks before `run` acquires its +generation/publication locks. `run` freshly rejects a task made stale in that +interval. Any later lock-wait optimization must remain compatible with old +coordinator processes sharing the namespace. + +The index is a candidate optimization until its observation/commit contract is +reviewable and preserves alias, reparse, path-replacement, ownership, concurrent +writer and recovery behavior. A safe fallback or fail-closed error is required +for unsupported/unstable topology; fallback time and occurrence must be measured +and cannot be hidden when claiming the 30-second target. + +## Implementation sequence + +1. **Define contracts and benchmark fixtures.** Freeze the existing engine as a + behavioral reference. Establish the 2,172-claim/11-plan workload plus anonymous + existing/missing-root, depth, target-count and shared-build variants. Inventory + the filesystem guarantees currently supplied by both CMake and Python. +2. **Prove the new validation core behind the current entry point.** Refactor + record authentication and prototype the indexed observation model with 64/256 + claims first. Keep the current public helpers and generation path while + resolving the safety proof. Proceed to larger cases only after the operation + counts and measured budget justify them. This is the first decisive milestone. +3. **Package the proven engine.** Move the established boundaries into the Python + package, retaining a compatibility launcher and record/lock interoperability. + Make the POC and benchmark import the real implementation and fingerprint its + source bundle. Measuring a thin launcher and reporting zero projections would + be a false improvement. +4. **Thin the CMake adapter incrementally.** Move one orchestration responsibility + at a time, retaining transport, dependency, timeout, cross-build, multi-config, + ownership and recovery tests. Remove replaced CMake guards only after proving + equivalent protection at the corresponding engine boundary. +5. **Expose the standalone CLI.** Reuse the exact planning/run API and shared + ownership rules. Test the one-command normal case and actionable failures; + do not make users operate the internal protocol or reset state to upgrade. + +Do not combine a new database, registry-format migration, lock-order change, +language rewrite and user-facing configuration system with this first fix. +Those would obscure whether the algorithm is faster and whether safety survived. + +## Acceptance criteria + +- All validation, including authentication and required freshness checks, is + below 30 seconds for the stated 2,172/11 benchmark environments; aim below + 25 seconds to leave margin. Report setup, lock wait and reconciliation separately. +- Metadata operation growth follows unique geometry/reservations, with every + retained claim still authenticated and all overlap/ownership rules retained. +- Adversarial mutation, alias, concurrent-writer and crash-recovery tests pass, + alongside a reviewed argument for the new observation lifetime. +- Existing quickstart, FetchContent, installed-prefix and superbuild consumers + work without new project configuration or manual environment activation. +- Moved/read-only prefixes, offline tool overrides and cross compilation remain + supported, with explicit host-tool selection where required. +- An unchanged second build does no unnecessary code generation; import and + tool/backend changes still trigger the appropriate work. +- The new standalone normal case works through one command after tool installation. + Internal task manifests, registry maintenance and performance switches stay + out of the required user workflow. + +This document is an implementation proposal. The new CLI and packaged backend +described here have not been implemented, and the 30-second target is not yet proven. diff --git a/docs/registry-validation-30s-plan.md b/docs/registry-validation-30s-plan.md new file mode 100644 index 0000000..94f6c8b --- /dev/null +++ b/docs/registry-validation-30s-plan.md @@ -0,0 +1,172 @@ +# Assessing a 30-second validation target + +## What has actually been reproduced + +There is a scalable, explicitly isolated synthetic reproduction of the same +registry-validation bottleneck. There is **not** a measured synthetic run that +matches the reported 751.875 s consumer observation exactly. + +| Case | Retained claims | Current plans | Validation | Status | +| --- | ---: | ---: | ---: | --- | +| Public issue #54 consumer observation | 2,172 | 11 | 751.875 s | Reported observation; consumer registry not accessed here | +| Earlier large synthetic run | 1,024 | 11 | 220.612 s | Measured on the first issue-54 implementation, Python 3.14.4 | +| Same synthetic shape at 2,172 claims | 2,172 | 11 | About 468 s | Simple size extrapolation of the preceding row, **not a measurement** | + +The final small refinement did not establish an additional wall-time speedup. +The large measurement and extrapolation must not be relabeled as final-code +large-run results. Setup for the 1,024-claim case took another 136.632 s and is +excluded from validation. + +An exact-size synthetic baseline can already be run from the repository root: + +```powershell +py -3.12 -B tests/benchmark_output_registry.py --large --claims 2172 --plans 11 --repeat 1 --work .pytest-tmp/registry-2172-baseline +``` + +The workspace must not exist. Fixture setup and validation can take minutes on +the current algorithm. Every sample has a new private registry and uses real +locked initialization/reconciliation helpers; measured validation skips no +checks. Publish only sanitized results, never fixture directories. + +This fixture has one target/output per plan, distinct synthetic build directories, +and initially absent output/staging directories. Equal claim/plan counts do not +make it a calibrated consumer-equivalent workload. Existing/missing roots, +targets per claim, shared build identities, directory depth and record sizes +must also be covered using anonymous layouts. We should not add artificial work +just to make a baseline last 750 seconds. + +## Required improvement and remaining cost + +751.875 s to under 30 s requires **more than 25x** improvement. Even the rough +468 s synthetic projection would need approximately **16x**. Changing locks or +replacing individual stat APIs does not address that scale of work. + +The one-target synthetic cases currently perform approximately +`117 * retained_claims + 133` path projections during registry validation when +there are eleven current plans and at least one retained claim. This matches +the observed 119,941 projections at 1,024 claims and predicts about 254,257 at +2,172 claims. This is an operation-count inference, not a new large measurement. + +A new bounded phase profile on **CPython 3.12.9** checked 64 retained claims +against eleven plans. Setup was separate; every retained claim/plan was checked. +The disjoint outermost function timers measured: + +| Registry-validation work | Seconds | Share | +| --- | ---: | ---: | +| Direct overlap comparisons and repeated current-root keying | 6.634 | 87.8% | +| Claim JSON/path authentication and complete recorded-plan authentication | 0.871 | 11.5% | +| Remaining work | 0.055 | 0.7% | +| Total registry validation | 7.560 | 100% | + +The authentication row includes its nested filesystem checks and plan parsing; +it is **not** just JSON decoding. Nested costs are not counted again in the +comparison row. The scan authenticated all 64 recorded plans, made 2,860 direct +overlap comparisons and derived 704 current-root keys. Lock preparation/acquisition +was 0.143 s, separately from validation. Current-plan validation was 0.399 s. + +Simply extrapolating the authentication row to 2,172 claims gives about **29.6 s** +before the new conflict algorithm or its freshness checks. That is a descriptive +estimate from one instrumented run, not a lower bound or timing guarantee. +Nevertheless, it shows why optimizing only the cross product is insufficient: +record authentication must also stop repeatedly projecting the same paths. + +The reproducible profiler is `tests/profile_output_registry.py`: + +```powershell +py -3.12 -B tests/profile_output_registry.py --claims 64 --plans 11 --work .pytest-tmp/registry-phase-profile +``` + +It delegates every operation unchanged, verifies one authentication per retained +record, restores its wrappers, and writes path-free metrics. Results for this +assessment are in [registry-validation-feasibility.json](registry-validation-feasibility.json). +All these timings include instrumentation and uncontrolled workstation/cache +effects; use counts and matched baseline/candidate runs for acceptance. + +## Architecture needed for an order-of-magnitude reduction + +The recommended research direction is a **transient ownership index with an +explicit filesystem-observation/commit contract**, plus record-authentication +refactoring. This is a proposed design to prove, not permission to enable broad +caching under the existing per-comparison freshness contract. + +1. **Separate record decoding from filesystem authority.** Split the work now + coupled in `_load_recorded_plan`, `Plan.from_payload`, `_claim_paths`, + `_require_plan_claim_binding` and `_validate_staging_path`. Read every record, + validate every shape/digest/ownership binding and keep the registry lock. + Authenticate path-dependent identities from an explicit observation object + rather than recursively projecting root/build/staging paths again. Immutable + JSON can be retained under the existing registry-lock contract; filesystem + observations need a separate, justified lifetime. +2. **Index all root and staging reservations.** Index canonical lexical prefixes, + physical directory/ancestor identities and missing-suffix relationships, + including owner/build/target metadata. Lookup must cover containment in both + directions, aliases of missing ancestors, and the existing retirement/same-owner + exceptions. Every retained claim still participates. A lexical-only path trie + cannot substitute for physical identity checks. +3. **Move filesystem work out of the claim × plan loop.** Build the index from + bounded observations and perform conflict queries against the current plans. + Aim for metadata work proportional to unique paths/components and necessary + revalidation passes, rather than repeatedly walking ancestors per pair. + The desired normal-case shape is approximately `O(unique path components + + reservations + current-plan lookups)`, with appropriate indexing overhead. + Even linear passes will fail the target if the old repeated authentication + walks remain inside them. +4. **Prove the observation boundary before production use.** This is the difficult + step. A registry lock protects cooperating record writers, not arbitrary + external renames, reparse changes or creation of formerly missing components. + An indexed negative conflict result can become stale through a foreign path, + even if the current output root itself is freshly checked. The design must + identify every dependency, invalidate/rebuild on changed bindings and freshly + validate authority before mutation. Two matching metadata sweeps, a timestamp, + a registry version or a filesystem watcher alone are not proof that topology + remained unchanged. Any handle/identity-based scheme still needs a proof of + the relationship between those objects, their names and missing components. +5. **Retain mutation-time protections.** Claim initialization, recovery, + retirement, reset and publication must keep their existing ownership and + topology checks. Do not carry an index through released locks or mutations. + Changes must fail closed with bounded recovery/retry behavior. If a safe + invalidation scheme requires returning to the full cross product, the proposed + design has failed its performance objective and must not be advertised as a + solution. + +This could cut hundreds of thousands of repeated projections to a small number +of passes over thousands of distinct locations and their shared ancestors. That +is enough algorithmic headroom to make 30 seconds plausible. It is **not yet a +safety-proven design or a demonstrated 30-second result**. Under the unchanged +rule that each pair performs fresh full walks, there is no evidence that local +tuning can produce the required 16–25x improvement. + +## Finite next phase and acceptance + +1. Freeze one exact-size 2,172/11 synthetic baseline and representative anonymous + layout variants. Define the target as **all validation work under 30 s**, + including record I/O/authentication, geometry checks, conflict queries and + any required fresh revalidation. Keep fixture setup, lock waiting and output + reconciliation separately reported. +2. First prototype only record authentication and linear geometry observation + under a written consistency contract. Measure 64 and 256 claims, plus operation + counts. Budget the full 2,172/11 validation at less than 25 s to leave margin. + If minimum safe observation/authentication work already consumes that budget, + stop and revise the architecture before implementing the full index. +3. Prove race/alias behavior with injections between observation, lookup, + precommit revalidation and actual mutations. Include foreign-path replacement, + missing-component creation, ancestor replacement, ABA-style changes, Windows + case/short-name aliases, links/junctions, concurrent writers and crash recovery. + Existing passing tests are necessary but not a proof of the new lifetime model. +4. Add the ownership index only after the safety argument is reviewable. Require + operation growth close to the number of reservations/unique components when + moving through 64, 256, 1,024 and 2,172 claims with eleven plans. Require every + record to remain authenticated and no lost overlap/ownership rejection. +5. Run the exact-size case and representative layout cases with the final design. + Report first-process and repeated-process samples honestly; a fresh process + does not imply a cold OS filesystem cache. Claim the target only from measured + results on the stated environment, with instrumentation overhead disclosed. + +Lock-wait convoy improvements can be pursued separately with the compatible +release/retry protocol discussed in [the locking review](registry-validation-refinements.md#locking-assessment). +They help unrelated writers under contention but cannot remove 750 seconds of +active validation work. Clearing retained claims, dropping physical checks, +changing the shared namespace or relaxing safety to meet a timing gate are not +part of this plan. + +No production coordinator logic was changed for this feasibility assessment. diff --git a/docs/registry-validation-design.md b/docs/registry-validation-design.md new file mode 100644 index 0000000..fe1f904 --- /dev/null +++ b/docs/registry-validation-design.md @@ -0,0 +1,139 @@ +# Registry validation follow-up (#54) + +## Analysis and proposal (before coordinator changes) + +The current checkout includes #52: `reconcile_set` scans the registry once and +authenticates each retained claim/configured plan once, rather than once per +current plan. The remaining confirmed cost is the retained-claim/current-plan +cross product in `_validate_registry`, including root/root, staging/root, +root/staging and staging/staging comparisons. Every comparison projects both +paths and performs physical containment in both directions. Missing suffixes +are repeatedly searched for an existing ancestor; `samefile` adds two following +stat calls per ancestor beside the non-following identity checks. JSON loading, +current-plan all-pairs validation, lock waiting, reconciliation and fixture +setup are separate costs. Reported consumer timing is evidence of validation +cost, not proof that every metadata call is redundant or that claims leaked. + +### Ownership and locks + +A physical output root has an immutable claim (root/build identities and token), +a configured plan (targets, staging reservations and outputs), a committed +snapshot (generation and output digests), and possibly durable pending intent. +Publication recovers pending work by rolling forward. Initialization publishes +the snapshot before the claim. Reset authenticates ownership, persists absence +of owned outputs, and only then releases the claim. Empty plans and missing build +directories do not release ownership. Test-looking names and age are not proof +that a claim is disposable; this change will not prune retained claims. + +Reconciliation takes registry, then sorted generation, then sorted publication +locks, retaining them through plan commits. Reset takes the same ordering for +one root. Generation holds its root generation lock; publication/validation +take the publication lock. Claim/plan writers serialize via registry; payload +writers serialize via publication. Keep these lifetimes and the shared namespace. +Reducing validation time reduces registry-lock occupancy without moving checks +outside the lock or introducing a writer race. + +Locks do not freeze arbitrary filesystem topology. Projection rejects links, +junctions and non-directory ancestors, resolves Windows case/short spellings, +and appends a normalized missing suffix. Physical identity checks catch aliases +that lexical containment cannot see, including aliases of existing ancestors of +missing paths. File/directory, ancestor and reparse replacements can occur after +projection or between comparisons. The existing comment forbidding reuse across +comparisons is a safety contract, not an invitation to operation-wide caching. +Neither the existing nor proposed path API provides an atomic filesystem +snapshot against arbitrary external writers; mutation-time checks remain vital. + +### Recommended bounded change + +Keep the complete claim/current-plan cross product and two fresh projections +per `_paths_overlap`. Replace repeated physical ancestor searches with a local +physical ancestry observation in `_projected_physically_contains`. Observe each +component with non-following metadata, reject links/non-directories, identify +ordinary directories by device/inode (the same identity relation as `samefile`), +and represent missing descendants by that identity plus case-folded suffixes. +Compare the parent's location key against the child's ancestor keys. No +observations escape that single directional comparison. Retain the separate +reverse comparison and all projection, claim binding and mutation-time checks. +This reduces physical metadata work from quadratic in missing depth to linear in +total depth and removes following stat probes duplicating ordinary-directory +identity. Constructing all missing-suffix tuple prefixes still has quadratic +worst-case Python copying cost in missing depth; filesystem probes are linear. +For bounded targets/depth the registry remains O(claims * current plans), with +lower filesystem work; no sublinear registry-scaling claim is intended. + +If measurements show projection dominates, assess its repeated metadata walks +separately; do not combine observations across comparisons to meet a timing goal. +The initial implementation surfaces are physical containment helpers, progress, +focused regression tests and the reusable benchmark. + +Alternative: an operation-wide identity index could reduce projections toward +O(claims + plans), but external changes can invalidate a negative conflict lookup +without touching registry records. Fresh revalidation could restore the cross +product, while watcher-based invalidation is platform-specific and incomplete. +A durable ownership index also requires migration/crash recovery and does not +solve topology invalidation. Those are separate designs, not this bounded fix. +Pure lexical filtering is unsafe for physical aliases. No registry observations +will be reused across pairs, lock acquisitions, mutations, or publication. + +Reconciliation must still freshly derive state/lock keys, authenticate claims and +plans, recover snapshots and validate output/staging topology before mutation. +Publication retains its own current-plan, payload, containment, destination and +transaction checks; no optimization token grants later filesystem authority. + +### Progress, isolation and acceptance + +Continue path-free phase/count/timing reports at five-second frequency for the +whole operation. Bound frequency rather than total report count; retain silence +for fast operations, completion/failure reports and clean stdout claim tokens. +Remove the lifetime cap; adapt the POC's progress metadata to report no cutoff +when that constant is absent. Leave its measured reconciliation method intact. + +Direct coordinator tests already pass explicit temporary lock roots. CMake +ownership fixtures choose temporary `output-locks`; inspect other integration +fixtures before running them. Benchmarks must use a new explicitly isolated +registry for every sample. Keep synthetic records untracked because they contain +local paths. Only sanitized scripts, counts and timing summaries are deliverables. + +Acceptance: existing adversarial/recovery/concurrent-writer tests pass; add +bounded-depth operation-count coverage, aliases of missing ancestors, replacement +after projection and between comparisons, and progress past the former cutoff. +Run the issue's unchanged measured `reconcile_set((), current)` POC matrix +(0/8/16 claims, 1/11 plans) before/after. Count filesystem calls as well as time; +keep setup separate. Adapt only the POC progress metadata if necessary, preserving +the production measurement unchanged. Extend the maintained benchmark to allow +thousands of claims with explicit opt-in and linear private fixture seeding using +real locked initialization/reconciliation, as in the issue POC. First run 64/11; +then cap larger work at one 1,024/11 sample if projected runtime is reasonable. +Do not run the old quadratic seeding path at thousands of claims. Record skips, +actual costs and limitations rather than inferring results from small samples. + +## Implementation decisions after the pilot + +The baseline coordinator's LF-normalized SHA-256 matches the issue exactly: +`2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85`. +The local checkout was retained on its existing history and a new task branch. +Private fixture directories are under ignored pytest storage. + +The ancestry helper retains both directional observations and projection at +every pair. `samefile` uses the same device/inode equality now obtained through +non-following metadata for ordinary directories. Alias test doubles therefore +model matching directory IDs, rather than overriding only the removed stat API. +Added checks cover missing depth, ancestor replacement, Windows short spellings, +and the progress worker surviving the old lifetime cutoff. + +The isolation audit found older CMake integration fixtures that exercise the +default selector. An autouse fixture gives marked CMake tests a private cache +base (`LOCALAPPDATA` on Windows, `XDG_CACHE_HOME` elsewhere), retaining a shared +namespace across build trees within each test. Explicit lock-root tests retain +their explicit selection. No existing shared registry was inspected or changed. + +The 64-claim/11-plan pilot measured 9.02 s setup and 12.34 s registry validation. +The larger measured run is capped at 1,024 claims/11 plans, roughly six minutes +projected including setup; 2,048+ cases are supported but not measured here. +The benchmark now separately measures lock acquisition, actual registry-lock +occupancy, and current-plan validation, and enforces a new directory per sample. + +The later [optimization review](registry-validation-refinements.md) evaluates +further metadata and locking changes. Its final refinement removes a repeated +existence search used only to construct the projection's ancestor list, while +retaining every component check, leaf type check, strict resolution and retry. diff --git a/docs/registry-validation-feasibility.json b/docs/registry-validation-feasibility.json new file mode 100644 index 0000000..6cef532 --- /dev/null +++ b/docs/registry-validation-feasibility.json @@ -0,0 +1,57 @@ +{ + "platform": "Windows", + "python": "3.12.9", + "coordinator_sha256": "1b0fb79eae89041c2b4949c713ec66d8d18e28941780a6652ddd6fb619b2bf87", + "timings_include_instrumentation": true, + "measurement": "Disjoint outermost function timers; every check delegates unchanged", + "sample": { + "retained_claims": 64, + "current_plans": 11, + "seed_wall_seconds": 4.133827799989376, + "seed_cpu_seconds": 2.9375, + "validation_wall_seconds": 7.560460099950433, + "validation_cpu_seconds": 7.484375, + "reconcile_wall_seconds": 8.651100200018845, + "reconcile_cpu_seconds": 8.390625, + "lock_wait_wall_seconds": 0.14277940010651946, + "registry_lock_held_wall_seconds": 8.637750900001265, + "current_plan_validation_wall_seconds": 0.3990691000362858, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 64, + "path_projections_in_validation": 7621, + "path_projections_total": 8655, + "validation_filesystem_calls": { + "nt.stat": 160990, + "nt.lstat": 14664, + "nt._getfinalpathname": 15242 + }, + "completed_plans": 11 + }, + "disjoint_direct_registry_phases": { + "project_path": { + "calls": 45, + "wall_seconds": 0.025041300046723336 + }, + "_paths_overlap": { + "calls": 2860, + "wall_seconds": 6.196185298904311 + }, + "_load_json": { + "calls": 64, + "wall_seconds": 0.06436010013567284 + }, + "claim_path_authentication": { + "calls": 64, + "wall_seconds": 0.15887819975614548 + }, + "recorded_plan_authentication": { + "calls": 64, + "wall_seconds": 0.6475167000317015 + }, + "_path_key": { + "calls": 704, + "wall_seconds": 0.43822220008587465 + } + } +} diff --git a/docs/registry-validation-refinements.md b/docs/registry-validation-refinements.md new file mode 100644 index 0000000..0d44aac --- /dev/null +++ b/docs/registry-validation-refinements.md @@ -0,0 +1,198 @@ +# Further registry optimization review + +This follow-up compares against the first issue #54 implementation, rather than +claiming its improvements again. All measurements use new private registries; +the previous coordinator is preserved only in ignored local comparison storage. + +Final choice: keep only lexical ancestor-list construction, eliminating one +duplicate existence query per stable projection. The Windows attribute-query +experiment was tested and discarded: its incremental benefit was inconsistent +across installed Python 3.12.9 and 3.14.4. Lock ordering/lifetime is unchanged. + +## Findings and proposed changes (before implementation) + +An 8-claim/11-plan profile measured 2.005 s registry validation. `project_path` +accounted for 1.230 s cumulatively; `_is_link` accounted for 0.616 s through +9,775 rich `lstat` probes. Physical ancestry checks accounted for another +0.744 s. These cumulative costs overlap and must not be added together. +The process performed 19,537 `lstat`, 1,069 `stat`, 3,077 native existence +queries and 2,138 final-path resolutions during registry validation. + +Two bounded improvements are worth testing: + +1. On Windows, `_is_link` only needs to know whether an ordinary path could be + a link/reparse point. Query `GetFileAttributesW` freshly at every existing + check. If the query succeeds and the reparse bit is absent, return false. + For every reparse point or failed query, use the existing `lstat` and tag/ + mode handling unchanged. Do not replace physical identity probes, final-path + resolution, directory-type checks, or post-projection revalidation. +2. `_existing_chain` repeats existence searches only to construct an ancestor + list. Construct that list lexically instead, retaining a fresh link check for + every component, the separate leaf type check, strict resolution and all + eight retry attempts. If the leaf disappears, these subsequent observations + still retry the complete projection. No existence observation is reused. + +Only the Win32 function binding may be retained, never returned attributes. +Pass the original spelling to the API: adding an extended-path prefix would +change Windows trailing-dot/space normalization. Embedded NUL input must fall +back to the original path API, avoiding C-string truncation. Failed attribute +queries (including share roots or long paths) must also fall back, preserving +the original permission-error and missing-path behavior. Other reparse tags +must retain their original treatment rather than rejecting all reparse points. +Non-Windows `_is_link` behavior remains unchanged. + +The first change substitutes a cheaper query for rich metadata; it does not +remove the corresponding filesystem observation. Count the new native queries +explicitly in both benchmark and POC. The second change removes an actual +existence probe per projection without removing link/type/identity checks. +The complete retained-claim/current-plan cross product remains O(claims * plans) +for bounded target counts and depth; no cross-comparison cache is introduced. + +Windows API contracts used here are documented by Microsoft: +[GetFileAttributesW](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfileattributesw) +and [file attribute constants](https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants). + +## Locking assessment + +The measured 1,024-claim run spent 220.612 s in registry validation but only +0.246 s preparing/acquiring locks. Removing a lock cannot address that dominant +cost. Registry serialization protects claim/plan visibility through commit; +generation locks exclude active generators and staging retirement; publication +locks exclude recovery/output mutations. Keep all three and the current order. + +There is a separate potential contention problem: reconciliation holds registry +while waiting for a busy root's generation lock, blocking unrelated claim writers. +The uncontended POC does not measure that scenario. Addressing it requires a +coordinated protocol change, not deleting an acquisition: + +- Taking generation locks before registry for every reconciliation/reset writer + could avoid this convoy, but mixing old/new ordering deadlocks. Old processes + from other checkouts can still share the registry, so a unilateral reorder is + unsafe without a compatible migration protocol. +- A nonblocking generation-lock attempt while holding registry, followed by + releasing all locks before waiting/retrying, preserves acquisition order but + needs starvation bounds, fresh key/path validation and concurrency coverage. + It could reduce unrelated-writer latency; it will not speed up the single + operation's filesystem validation. Leave this as a targeted future experiment. +- Shared registry reads or validation outside the exclusive lock need a registry + generation/retry protocol and revalidation before publication. Registry version + checks alone do not detect external filesystem replacements. No such shortcut + is justified by the present measurements. + +## Bounded acceptance plan + +Test the attribute fast path, both fallback cases, access failures, arbitrary +reparse tags, original Windows path spellings, embedded NUL, and real junctions. +Retain and strengthen disappearing-leaf, replacement-between-observations, +alias, crash/recovery and concurrent-writer regressions. Count native attribute +and existence queries so replacing `lstat` cannot masquerade as eliminating all +filesystem work. Run an alternating small benchmark matrix against the first +issue #54 implementation, plus focused/full unit tests and focused CMake tests. +Only repeat the 1,024-claim run if the pilot demonstrates a meaningful gain; +keep that run bounded at one sample and approximately six minutes including setup. + +## Results and final implementation + +All timings are instrumented Windows workstation observations, with uncontrolled +cache/machine activity. Operation counts are more reliable than small timing +differences. Samples are retained in the `refinements` section of +[the sanitized result JSON](registry-validation-results.json). + +The initial combined prototype (attribute queries plus lexical ancestor list) +showed 4.150 s → 3.791 s median registry validation and 6.639 s → 5.745 s total +reconciliation over three alternating 16-claim/11-plan pairs. A full small POC +matrix completed for both sources. Further tests compared the attribute fast +path specifically against the simpler lexical-list variant: + +| Runtime | Simple variant total median | Attribute variant total median | Attribute variant change | +| --- | ---: | ---: | ---: | +| CPython 3.14.4 | 5.886 s | 6.004 s | 2.0% slower | +| CPython 3.12.9 | 5.991 s | 5.672 s | 5.3% faster | + +Each comparison used three alternating pairs. The Python 3.14 validation CPU +median also rose from 3.500 s to 3.781 s with the attribute variant. These mixed +results do not justify extra platform code and fallback semantics. The prototype +passed its focused fallback/path-spelling safety tests, but performance still +failed to establish a reliable advantage. No attribute fast path remains in the +coordinator. Its optional instrumentation remains available when comparing +experimental sources so old measurements do not conceal their replacement queries. + +The final retained change was then compared directly against the previous issue +#54 implementation, with three alternating 16-claim/11-plan pairs on Python +3.14.4: + +| Measurement | Previous fix | Final refinement | +| --- | ---: | ---: | +| Native existence queries during registry validation | 5,821 | 3,816 | +| `stat` / `lstat` calls | 45,814 | 45,814 | +| Final-path resolutions | 4,010 | 4,010 | +| Path projections | 2,005 | 2,005 | +| Registry scans / recorded-plan loads | 1 / 16 | 1 / 16 | +| Median registry validation | 3.398 s | 3.405 s | +| Median total reconciliation | 5.395 s | 5.398 s | +| Median registry-lock occupancy | 5.368 s | 5.363 s | + +This removes exactly 2,005 existence queries (34.4% of that query family; 3.6% +of the metadata operations counted in this table). It preserves every link, +directory type and physical identity observation. Overall timing is within +noise, so no additional wall-time speedup is established. Retain the small +portable simplification and its concrete query reduction, rather than claiming +the prototype's early apparent speedup for the final code. + +The final POC matrix also ran on the installed CPython **3.12.9**, matching the +original issue's runtime. All twelve before/after reconciliations completed. +That Python reports existence queries as `nt.lstat`, while newer Python reports +the corresponding calls as `nt._path_lexists`: + +| Claims / plans | Baseline existence queries | Final existence queries | Eliminated queries / projections | +| --- | ---: | ---: | ---: | +| 0 / 1 | 32 | 20 | 12 | +| 0 / 11 | 342 | 210 | 132 | +| 8 / 1 | 617 | 388 | 229 | +| 8 / 11 | 3,077 | 2,008 | 1,069 | +| 16 / 1 | 1,201 | 756 | 445 | +| 16 / 11 | 5,821 | 3,816 | 2,005 | + +The other counted `nt.stat` and final-path calls stayed identical in every pair. +For 16/11, validation was 3.276 s → 3.416 s in the single POC samples, with +identical 2.969 s CPU: again, no extra wall-time speedup is established. The +timing decision is supported by both runtimes rather than selecting a favorable +early sample. + +The combined prototype's 64-claim pilot took 8.998 s setup and 15.911 s registry +validation. Given the mixed incremental benefit, the bounded-cost decision was +to stop large benchmark work after this pilot. The earlier 1,024-claim run +belongs to the first implementation; no final-refinement 1,024+ speedup is claimed. +The remaining claims × plans work still needs an architecture change for a +large reduction. An index must account for mutable physical topology, and a +lock-wait improvement must address contention while remaining compatible with +older coordinator processes. + +The production change is restricted to deleting `_existing_chain` and building +the same lexical ancestor list inside `project_path`. The new regression covers +the initial leaf becoming absent, a regular file or a directory link before +ancestor checks. Fresh checks and the strict-resolution retry remain. No claim +records, lock protocol, durability fences or publication checks were changed. + +## Final verification + +- Python 3.14.4 full non-CMake suite: **1,724 passed, 41 skipped** (88.31 s). +- Python 3.12.9 coordinator suite: **87 passed, 6 skipped** (61.56 s). + The existing repository pytest package was reused through this process's + import path with plugin autoload disabled; no packages were installed. +- Python 3.14.4 focused CMake integration suite: **16 passed, 1 skipped** + (69.70 s), including lock-wait diagnostics, recovery, competing writers and + the test-registry isolation check. +- Both final Python 3.12.9 POC matrices completed, including continuous progress + and completion diagnostics with no cutoff. +- `ruff check src tests cmake/ProtocyteOutputCoordinator.py`: passed. +- `git diff --check`: passed. +- Final source hashes match the measured final benchmark and POC candidates; + the follow-up baseline hash matches the first implementation's large run. + +Cross-platform runtime verification remains outstanding. No C++ files were +changed, and all fixture registries/data remain private and explicitly isolated. + +For the subsequent under-30-second target, see the [synthetic-equivalence and +architecture assessment](registry-validation-30s-plan.md), including a bounded +phase profiler and explicit performance/safety milestones. diff --git a/docs/registry-validation-results.json b/docs/registry-validation-results.json new file mode 100644 index 0000000..419d84c --- /dev/null +++ b/docs/registry-validation-results.json @@ -0,0 +1,2731 @@ +{ + "description": "Issue 54 isolated synthetic measurements; instrumented descriptive timings", + "baseline_lf_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", + "poc_baseline": { + "os": "Windows", + "python": "3.14.4", + "coordinator_sha256": "13aa1a7daea37f06f5298c2119be440b9c48347112494e066986d4387c7e3858", + "timings_include_instrumentation": true, + "samples": [ + { + "repetition": 0, + "retained_claims": 0, + "current_plans": 1, + "setup_seconds": 0.043002, + "validation_wall_seconds": 0.046477, + "validation_cpu_seconds": 0.015625, + "reconcile_wall_seconds": 0.181212, + "reconcile_cpu_seconds": 0.125, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 12, + "_physical_location_key": 106, + "_same_physical_path": 97, + "_paths_overlap": 4 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 142, + "own_seconds": 0.012202 + }, + "nt.lstat": { + "calls": 239, + "own_seconds": 0.021578 + }, + "nt._getfinalpathname": { + "calls": 24, + "own_seconds": 0.002912 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 0, + "current_plans": 11, + "setup_seconds": 0.237473, + "validation_wall_seconds": 0.379158, + "validation_cpu_seconds": 0.3125, + "reconcile_wall_seconds": 2.864267, + "reconcile_cpu_seconds": 1.875, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 132, + "_physical_location_key": 1166, + "_same_physical_path": 1067, + "_paths_overlap": 44 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 1562, + "own_seconds": 0.104094 + }, + "nt.lstat": { + "calls": 2629, + "own_seconds": 0.173107 + }, + "nt._getfinalpathname": { + "calls": 264, + "own_seconds": 0.027992 + } + }, + "completed_plans": 11 + }, + { + "repetition": 0, + "retained_claims": 8, + "current_plans": 1, + "setup_seconds": 1.251244, + "validation_wall_seconds": 0.32841, + "validation_cpu_seconds": 0.296875, + "reconcile_wall_seconds": 0.449497, + "reconcile_cpu_seconds": 0.375, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 229, + "_physical_location_key": 1066, + "_same_physical_path": 993, + "_paths_overlap": 44, + "_path_key": 56 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 1250, + "own_seconds": 0.04947 + }, + "nt.lstat": { + "calls": 3649, + "own_seconds": 0.155386 + }, + "nt._getfinalpathname": { + "calls": 458, + "own_seconds": 0.032071 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 8, + "current_plans": 11, + "setup_seconds": 1.218132, + "validation_wall_seconds": 2.211775, + "validation_cpu_seconds": 1.90625, + "reconcile_wall_seconds": 4.318072, + "reconcile_cpu_seconds": 3.359375, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 1069, + "_physical_location_key": 9806, + "_same_physical_path": 9003, + "_paths_overlap": 404, + "_path_key": 136 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 10540, + "own_seconds": 0.469462 + }, + "nt.lstat": { + "calls": 22189, + "own_seconds": 1.073724 + }, + "nt._getfinalpathname": { + "calls": 2138, + "own_seconds": 0.162666 + } + }, + "completed_plans": 11 + }, + { + "repetition": 0, + "retained_claims": 16, + "current_plans": 1, + "setup_seconds": 1.910242, + "validation_wall_seconds": 0.632456, + "validation_cpu_seconds": 0.546875, + "reconcile_wall_seconds": 0.74373, + "reconcile_cpu_seconds": 0.578125, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 445, + "_physical_location_key": 2026, + "_same_physical_path": 1889, + "_paths_overlap": 84, + "_path_key": 112 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 2346, + "own_seconds": 0.09239 + }, + "nt.lstat": { + "calls": 7049, + "own_seconds": 0.298174 + }, + "nt._getfinalpathname": { + "calls": 890, + "own_seconds": 0.062642 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "setup_seconds": 1.971172, + "validation_wall_seconds": 4.094103, + "validation_cpu_seconds": 3.453125, + "reconcile_wall_seconds": 6.298106, + "reconcile_cpu_seconds": 4.953125, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 2005, + "_physical_location_key": 18446, + "_same_physical_path": 16939, + "_paths_overlap": 764, + "_path_key": 272 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 19396, + "own_seconds": 0.856869 + }, + "nt.lstat": { + "calls": 41749, + "own_seconds": 1.98936 + }, + "nt._getfinalpathname": { + "calls": 4010, + "own_seconds": 0.295814 + } + }, + "completed_plans": 11 + } + ], + "progress_demo": { + "production_interval_seconds": 5.0, + "production_max_periodic_reports": 12, + "nominal_production_cutoff_seconds": 60.0, + "demo_interval_seconds": 0.01, + "periodic_reports": 12, + "claims_at_last_periodic_report": 19, + "claims_at_completion": 40, + "suppression_message_seen": true, + "completion_message_seen": true + } + }, + "poc_candidate": { + "os": "Windows", + "python": "3.14.4", + "coordinator_sha256": "2a3fad28c68b5976c887022268c11c7ecdaefcc129a4bd2f6a9eb01f77e3eb2d", + "timings_include_instrumentation": true, + "samples": [ + { + "repetition": 0, + "retained_claims": 0, + "current_plans": 1, + "setup_seconds": 0.037532, + "validation_wall_seconds": 0.029386, + "validation_cpu_seconds": 0.015625, + "reconcile_wall_seconds": 0.184244, + "reconcile_cpu_seconds": 0.09375, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 12, + "_physical_location_key": 9, + "_paths_overlap": 4 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 12, + "own_seconds": 0.000709 + }, + "nt.lstat": { + "calls": 234, + "own_seconds": 0.019115 + }, + "nt._getfinalpathname": { + "calls": 24, + "own_seconds": 0.002747 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 0, + "current_plans": 11, + "setup_seconds": 0.202995, + "validation_wall_seconds": 0.256031, + "validation_cpu_seconds": 0.203125, + "reconcile_wall_seconds": 3.152033, + "reconcile_cpu_seconds": 2.0, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 132, + "_physical_location_key": 99, + "_paths_overlap": 44 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 132, + "own_seconds": 0.007874 + }, + "nt.lstat": { + "calls": 2574, + "own_seconds": 0.163693 + }, + "nt._getfinalpathname": { + "calls": 264, + "own_seconds": 0.024221 + } + }, + "completed_plans": 11 + }, + { + "repetition": 0, + "retained_claims": 8, + "current_plans": 1, + "setup_seconds": 1.632386, + "validation_wall_seconds": 0.674728, + "validation_cpu_seconds": 0.4375, + "reconcile_wall_seconds": 0.925574, + "reconcile_cpu_seconds": 0.578125, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 229, + "_physical_location_key": 89, + "_paths_overlap": 44, + "_path_key": 56, + "_same_physical_path": 16 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 229, + "own_seconds": 0.025218 + }, + "nt.lstat": { + "calls": 3565, + "own_seconds": 0.412761 + }, + "nt._getfinalpathname": { + "calls": 458, + "own_seconds": 0.071264 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 8, + "current_plans": 11, + "setup_seconds": 2.312549, + "validation_wall_seconds": 2.09775, + "validation_cpu_seconds": 1.65625, + "reconcile_wall_seconds": 4.446544, + "reconcile_cpu_seconds": 3.03125, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 1069, + "_physical_location_key": 819, + "_paths_overlap": 404, + "_path_key": 136, + "_same_physical_path": 16 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 1069, + "own_seconds": 0.063701 + }, + "nt.lstat": { + "calls": 21425, + "own_seconds": 1.318545 + }, + "nt._getfinalpathname": { + "calls": 2138, + "own_seconds": 0.192584 + } + }, + "completed_plans": 11 + }, + { + "repetition": 0, + "retained_claims": 16, + "current_plans": 1, + "setup_seconds": 1.978547, + "validation_wall_seconds": 0.592637, + "validation_cpu_seconds": 0.515625, + "reconcile_wall_seconds": 0.72362, + "reconcile_cpu_seconds": 0.546875, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 445, + "_physical_location_key": 169, + "_paths_overlap": 84, + "_path_key": 112, + "_same_physical_path": 32 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 445, + "own_seconds": 0.020989 + }, + "nt.lstat": { + "calls": 6885, + "own_seconds": 0.331744 + }, + "nt._getfinalpathname": { + "calls": 890, + "own_seconds": 0.064971 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "setup_seconds": 2.135986, + "validation_wall_seconds": 3.673945, + "validation_cpu_seconds": 2.828125, + "reconcile_wall_seconds": 5.767887, + "reconcile_cpu_seconds": 4.171875, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 2005, + "_physical_location_key": 1539, + "_paths_overlap": 764, + "_path_key": 272, + "_same_physical_path": 32 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 2005, + "own_seconds": 0.110363 + }, + "nt.lstat": { + "calls": 40265, + "own_seconds": 2.280778 + }, + "nt._getfinalpathname": { + "calls": 4010, + "own_seconds": 0.34219 + } + }, + "completed_plans": 11 + } + ], + "progress_demo": { + "production_interval_seconds": 5.0, + "production_max_periodic_reports": 12, + "nominal_production_cutoff_seconds": 60.0, + "demo_interval_seconds": 0.01, + "periodic_reports": 26, + "claims_at_last_periodic_report": 39, + "claims_at_completion": 40, + "suppression_message_seen": false, + "completion_message_seen": true + } + }, + "alternating": { + "platform": "Windows", + "python": "3.14.4", + "timings_include_instrumentation": true, + "setup_method": "private locked initialization/reconciliation (issue #54 POC)", + "coordinator_sha256": { + "baseline": "13aa1a7daea37f06f5298c2119be440b9c48347112494e066986d4387c7e3858", + "candidate": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5" + }, + "samples": [ + { + "revision": "baseline", + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.258123899984639, + "seed_cpu_seconds": 1.28125, + "validation_wall_seconds": 6.3589739999733865, + "validation_cpu_seconds": 5.4375, + "reconcile_wall_seconds": 9.633987099980004, + "reconcile_cpu_seconds": 7.421875, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 20979, + "nt.lstat": 45293, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 3.7509025000035763, + "seed_cpu_seconds": 1.734375, + "validation_wall_seconds": 4.355008200043812, + "validation_cpu_seconds": 3.796875, + "reconcile_wall_seconds": 7.462864799948875, + "reconcile_cpu_seconds": 5.6875, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 1, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.709061599976849, + "seed_cpu_seconds": 1.625, + "validation_wall_seconds": 4.752622700005304, + "validation_cpu_seconds": 3.875, + "reconcile_wall_seconds": 7.622923300019465, + "reconcile_cpu_seconds": 5.640625, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + }, + { + "revision": "baseline", + "repetition": 1, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 3.1427328000427224, + "seed_cpu_seconds": 1.609375, + "validation_wall_seconds": 6.718977300042752, + "validation_cpu_seconds": 5.265625, + "reconcile_wall_seconds": 12.058677699998952, + "reconcile_cpu_seconds": 7.75, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 20979, + "nt.lstat": 45293, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + }, + { + "revision": "baseline", + "repetition": 2, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 3.1493273000232875, + "seed_cpu_seconds": 1.75, + "validation_wall_seconds": 7.2300827000290155, + "validation_cpu_seconds": 5.8125, + "reconcile_wall_seconds": 10.46813039999688, + "reconcile_cpu_seconds": 7.875, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 20979, + "nt.lstat": 45293, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 2, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.7407475999789312, + "seed_cpu_seconds": 1.578125, + "validation_wall_seconds": 4.551891399954911, + "validation_cpu_seconds": 4.078125, + "reconcile_wall_seconds": 7.671269699989352, + "reconcile_cpu_seconds": 6.046875, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + } + ], + "medians": [ + { + "retained_claims": 16, + "current_plans": 11, + "baseline": { + "seed_wall_seconds": 3.1427328000427224, + "seed_cpu_seconds": 1.609375, + "validation_wall_seconds": 6.718977300042752, + "validation_cpu_seconds": 5.4375, + "reconcile_wall_seconds": 10.46813039999688, + "reconcile_cpu_seconds": 7.75, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039 + }, + "candidate": { + "seed_wall_seconds": 2.7407475999789312, + "seed_cpu_seconds": 1.625, + "validation_wall_seconds": 4.551891399954911, + "validation_cpu_seconds": 3.875, + "reconcile_wall_seconds": 7.622923300019465, + "reconcile_cpu_seconds": 5.6875, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039 + }, + "wall_time_reduction_percent": 27.179706320607767 + } + ] + }, + "lock_occupancy": { + "platform": "Windows", + "python": "3.14.4", + "timings_include_instrumentation": true, + "setup_method": "private locked initialization/reconciliation (issue #54 POC)", + "coordinator_sha256": { + "baseline": "13aa1a7daea37f06f5298c2119be440b9c48347112494e066986d4387c7e3858", + "candidate": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5" + }, + "samples": [ + { + "revision": "baseline", + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.1276385000091977, + "seed_cpu_seconds": 1.359375, + "validation_wall_seconds": 4.7870832000044174, + "validation_cpu_seconds": 4.453125, + "reconcile_wall_seconds": 7.1144024999812245, + "reconcile_cpu_seconds": 6.21875, + "lock_wait_wall_seconds": 0.23898560006637126, + "registry_lock_held_wall_seconds": 7.090437799983192, + "current_plan_validation_wall_seconds": 1.0748708000173792, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 20979, + "nt.lstat": 45293, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.170645500009414, + "seed_cpu_seconds": 1.28125, + "validation_wall_seconds": 3.574637999990955, + "validation_cpu_seconds": 3.3125, + "reconcile_wall_seconds": 5.622308599995449, + "reconcile_cpu_seconds": 4.71875, + "lock_wait_wall_seconds": 0.2729834000347182, + "registry_lock_held_wall_seconds": 5.586250799999107, + "current_plan_validation_wall_seconds": 0.7457271000021137, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + } + ], + "medians": [ + { + "retained_claims": 16, + "current_plans": 11, + "baseline": { + "seed_wall_seconds": 2.1276385000091977, + "seed_cpu_seconds": 1.359375, + "validation_wall_seconds": 4.7870832000044174, + "validation_cpu_seconds": 4.453125, + "reconcile_wall_seconds": 7.1144024999812245, + "reconcile_cpu_seconds": 6.21875, + "lock_wait_wall_seconds": 0.23898560006637126, + "registry_lock_held_wall_seconds": 7.090437799983192, + "current_plan_validation_wall_seconds": 1.0748708000173792, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039 + }, + "candidate": { + "seed_wall_seconds": 2.170645500009414, + "seed_cpu_seconds": 1.28125, + "validation_wall_seconds": 3.574637999990955, + "validation_cpu_seconds": 3.3125, + "reconcile_wall_seconds": 5.622308599995449, + "reconcile_cpu_seconds": 4.71875, + "lock_wait_wall_seconds": 0.2729834000347182, + "registry_lock_held_wall_seconds": 5.586250799999107, + "current_plan_validation_wall_seconds": 0.7457271000021137, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039 + }, + "wall_time_reduction_percent": 20.972863146128052 + } + ] + }, + "medium": { + "platform": "Windows", + "python": "3.14.4", + "timings_include_instrumentation": true, + "setup_method": "private locked initialization/reconciliation (issue #54 POC)", + "coordinator_sha256": { + "candidate": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5" + }, + "samples": [ + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 64, + "current_plans": 11, + "seed_wall_seconds": 9.023429700057022, + "seed_cpu_seconds": 4.59375, + "validation_wall_seconds": 12.341692899994086, + "validation_cpu_seconds": 11.109375, + "reconcile_wall_seconds": 14.397634299995843, + "reconcile_cpu_seconds": 12.4375, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 64, + "path_projections_in_validation": 7621, + "path_projections_total": 8655, + "validation_filesystem_calls": { + "nt.stat": 7621, + "nt.lstat": 166785, + "nt._getfinalpathname": 15242 + }, + "completed_plans": 11 + } + ], + "medians": [ + { + "retained_claims": 64, + "current_plans": 11, + "candidate": { + "seed_wall_seconds": 9.023429700057022, + "seed_cpu_seconds": 4.59375, + "validation_wall_seconds": 12.341692899994086, + "validation_cpu_seconds": 11.109375, + "reconcile_wall_seconds": 14.397634299995843, + "reconcile_cpu_seconds": 12.4375, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 64, + "path_projections_in_validation": 7621, + "path_projections_total": 8655 + } + } + ] + }, + "large": { + "platform": "Windows", + "python": "3.14.4", + "timings_include_instrumentation": true, + "setup_method": "private locked initialization/reconciliation (issue #54 POC)", + "coordinator_sha256": { + "candidate": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5" + }, + "samples": [ + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 1024, + "current_plans": 11, + "seed_wall_seconds": 136.6321732000215, + "seed_cpu_seconds": 79.828125, + "validation_wall_seconds": 220.61243189999368, + "validation_cpu_seconds": 198.671875, + "reconcile_wall_seconds": 222.48733269999502, + "reconcile_cpu_seconds": 199.921875, + "lock_wait_wall_seconds": 0.24559350009076297, + "registry_lock_held_wall_seconds": 222.46272490004776, + "current_plan_validation_wall_seconds": 0.6697284000110812, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 1024, + "path_projections_in_validation": 119941, + "path_projections_total": 120975, + "validation_filesystem_calls": { + "nt.stat": 119941, + "nt.lstat": 2626305, + "nt._getfinalpathname": 239882 + }, + "completed_plans": 11 + } + ], + "medians": [ + { + "retained_claims": 1024, + "current_plans": 11, + "candidate": { + "seed_wall_seconds": 136.6321732000215, + "seed_cpu_seconds": 79.828125, + "validation_wall_seconds": 220.61243189999368, + "validation_cpu_seconds": 198.671875, + "reconcile_wall_seconds": 222.48733269999502, + "reconcile_cpu_seconds": 199.921875, + "lock_wait_wall_seconds": 0.24559350009076297, + "registry_lock_held_wall_seconds": 222.46272490004776, + "current_plan_validation_wall_seconds": 0.6697284000110812, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 1024, + "path_projections_in_validation": 119941, + "path_projections_total": 120975 + } + } + ] + }, + "poc_candidate_metadata_note": "Initial original-POC candidate run retained MAX_REPORTS as ignored legacy metadata; reporting was already uncapped (26 reports). Final code removes the constant. Reconciliation algorithm is unchanged; final POC smoke confirms current progress metadata.", + "final_poc_smoke": { + "os": "Windows", + "python": "3.14.4", + "coordinator_sha256": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5", + "timings_include_instrumentation": true, + "samples": [ + { + "repetition": 0, + "retained_claims": 0, + "current_plans": 1, + "setup_seconds": 0.040341, + "validation_wall_seconds": 0.021879, + "validation_cpu_seconds": 0.03125, + "reconcile_wall_seconds": 0.150081, + "reconcile_cpu_seconds": 0.0625, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 12, + "_physical_location_key": 9, + "_paths_overlap": 4 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 12, + "own_seconds": 0.000739 + }, + "nt.lstat": { + "calls": 234, + "own_seconds": 0.012535 + }, + "nt._getfinalpathname": { + "calls": 24, + "own_seconds": 0.002479 + } + }, + "completed_plans": 1 + } + ], + "progress_demo": { + "production_interval_seconds": 5.0, + "production_max_periodic_reports": null, + "nominal_production_cutoff_seconds": null, + "demo_interval_seconds": 0.01, + "periodic_reports": 26, + "claims_at_last_periodic_report": 39, + "claims_at_completion": 40, + "suppression_message_seen": false, + "completion_message_seen": true + } + }, + "refinements": { + "scope": "Compare follow-up refinements against the first issue-54 implementation; all registries isolated", + "final_choice": "Lexical ancestor list only; Windows attribute prototype was discarded", + "combined_prototype_comparison_py314": { + "platform": "Windows", + "python": "3.14.4", + "timings_include_instrumentation": true, + "setup_method": "private locked initialization/reconciliation (issue #54 POC)", + "coordinator_sha256": { + "baseline": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5", + "candidate": "87baa64350e2f36223570ce69ee93927a54146a9bcf62031b5ae4e87ab629ac6" + }, + "samples": [ + { + "revision": "baseline", + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 1.9613413999904878, + "seed_cpu_seconds": 1.078125, + "validation_wall_seconds": 5.155859499995131, + "validation_cpu_seconds": 3.96875, + "reconcile_wall_seconds": 7.1793177999788895, + "reconcile_cpu_seconds": 5.328125, + "lock_wait_wall_seconds": 0.23080189985921606, + "registry_lock_held_wall_seconds": 7.155724500014912, + "current_plan_validation_wall_seconds": 0.8358743999851868, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 5821 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.1849711000104435, + "seed_cpu_seconds": 1.359375, + "validation_wall_seconds": 5.154734499985352, + "validation_cpu_seconds": 4.234375, + "reconcile_wall_seconds": 7.726576299988665, + "reconcile_cpu_seconds": 5.9375, + "lock_wait_wall_seconds": 0.267664700106252, + "registry_lock_held_wall_seconds": 7.698233300005086, + "current_plan_validation_wall_seconds": 1.262812600005418, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "windows_attribute_probes": 22329, + "nt.stat": 2005, + "nt.lstat": 21480, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 3816 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 1, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.2232981999986805, + "seed_cpu_seconds": 1.25, + "validation_wall_seconds": 3.790756299975328, + "validation_cpu_seconds": 3.40625, + "reconcile_wall_seconds": 5.744733300001826, + "reconcile_cpu_seconds": 4.828125, + "lock_wait_wall_seconds": 0.24223959998926148, + "registry_lock_held_wall_seconds": 5.717330500017852, + "current_plan_validation_wall_seconds": 0.629817400011234, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "windows_attribute_probes": 22329, + "nt.stat": 2005, + "nt.lstat": 21480, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 3816 + }, + "completed_plans": 11 + }, + { + "revision": "baseline", + "repetition": 1, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.298384699970484, + "seed_cpu_seconds": 1.421875, + "validation_wall_seconds": 4.149868200009223, + "validation_cpu_seconds": 3.65625, + "reconcile_wall_seconds": 6.639396500017028, + "reconcile_cpu_seconds": 5.34375, + "lock_wait_wall_seconds": 0.2882600998855196, + "registry_lock_held_wall_seconds": 6.605098700034432, + "current_plan_validation_wall_seconds": 1.0071299000410363, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 5821 + }, + "completed_plans": 11 + }, + { + "revision": "baseline", + "repetition": 2, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.0844520999817178, + "seed_cpu_seconds": 1.171875, + "validation_wall_seconds": 3.584759099991061, + "validation_cpu_seconds": 3.296875, + "reconcile_wall_seconds": 5.59393169998657, + "reconcile_cpu_seconds": 4.671875, + "lock_wait_wall_seconds": 0.2621494000777602, + "registry_lock_held_wall_seconds": 5.56750959996134, + "current_plan_validation_wall_seconds": 0.7731327000074089, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 5821 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 2, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 1.9889954999671318, + "seed_cpu_seconds": 1.265625, + "validation_wall_seconds": 3.446725099987816, + "validation_cpu_seconds": 3.15625, + "reconcile_wall_seconds": 5.314111400046386, + "reconcile_cpu_seconds": 4.359375, + "lock_wait_wall_seconds": 0.25852360000135377, + "registry_lock_held_wall_seconds": 5.289039099996444, + "current_plan_validation_wall_seconds": 0.6422870999667794, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "windows_attribute_probes": 22329, + "nt.stat": 2005, + "nt.lstat": 21480, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 3816 + }, + "completed_plans": 11 + } + ], + "medians": [ + { + "retained_claims": 16, + "current_plans": 11, + "baseline": { + "seed_wall_seconds": 2.0844520999817178, + "seed_cpu_seconds": 1.171875, + "validation_wall_seconds": 4.149868200009223, + "validation_cpu_seconds": 3.65625, + "reconcile_wall_seconds": 6.639396500017028, + "reconcile_cpu_seconds": 5.328125, + "lock_wait_wall_seconds": 0.2621494000777602, + "registry_lock_held_wall_seconds": 6.605098700034432, + "current_plan_validation_wall_seconds": 0.8358743999851868, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039 + }, + "candidate": { + "seed_wall_seconds": 2.1849711000104435, + "seed_cpu_seconds": 1.265625, + "validation_wall_seconds": 3.790756299975328, + "validation_cpu_seconds": 3.40625, + "reconcile_wall_seconds": 5.744733300001826, + "reconcile_cpu_seconds": 4.828125, + "lock_wait_wall_seconds": 0.25852360000135377, + "registry_lock_held_wall_seconds": 5.717330500017852, + "current_plan_validation_wall_seconds": 0.6422870999667794, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039 + }, + "wall_time_reduction_percent": 13.475068103146237 + } + ] + }, + "combined_prototype_poc_before": { + "os": "Windows", + "python": "3.14.4", + "coordinator_sha256": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5", + "timings_include_instrumentation": true, + "samples": [ + { + "repetition": 0, + "retained_claims": 0, + "current_plans": 1, + "setup_seconds": 0.02917, + "validation_wall_seconds": 0.015855, + "validation_cpu_seconds": 0.015625, + "reconcile_wall_seconds": 0.14119, + "reconcile_cpu_seconds": 0.046875, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 12, + "_physical_location_key": 9, + "_paths_overlap": 4 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 12, + "own_seconds": 0.000412 + }, + "nt.lstat": { + "calls": 234, + "own_seconds": 0.009512 + }, + "nt._getfinalpathname": { + "calls": 24, + "own_seconds": 0.001531 + }, + "nt._path_lexists": { + "calls": 32, + "own_seconds": 0.00124 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 0, + "current_plans": 11, + "setup_seconds": 0.115803, + "validation_wall_seconds": 0.179843, + "validation_cpu_seconds": 0.171875, + "reconcile_wall_seconds": 2.006723, + "reconcile_cpu_seconds": 1.34375, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 132, + "_physical_location_key": 99, + "_paths_overlap": 44 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 132, + "own_seconds": 0.005514 + }, + "nt.lstat": { + "calls": 2574, + "own_seconds": 0.109306 + }, + "nt._getfinalpathname": { + "calls": 264, + "own_seconds": 0.018805 + }, + "nt._path_lexists": { + "calls": 342, + "own_seconds": 0.014903 + } + }, + "completed_plans": 11 + }, + { + "repetition": 0, + "retained_claims": 8, + "current_plans": 1, + "setup_seconds": 0.921561, + "validation_wall_seconds": 0.36597, + "validation_cpu_seconds": 0.3125, + "reconcile_wall_seconds": 0.494143, + "reconcile_cpu_seconds": 0.375, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 229, + "_physical_location_key": 89, + "_paths_overlap": 44, + "_path_key": 56, + "_same_physical_path": 16 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 229, + "own_seconds": 0.013301 + }, + "nt.lstat": { + "calls": 3565, + "own_seconds": 0.202078 + }, + "nt._getfinalpathname": { + "calls": 458, + "own_seconds": 0.0404 + }, + "nt._path_lexists": { + "calls": 617, + "own_seconds": 0.038689 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 8, + "current_plans": 11, + "setup_seconds": 1.278244, + "validation_wall_seconds": 2.982448, + "validation_cpu_seconds": 2.3125, + "reconcile_wall_seconds": 5.255259, + "reconcile_cpu_seconds": 3.890625, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 1069, + "_physical_location_key": 819, + "_paths_overlap": 404, + "_path_key": 136, + "_same_physical_path": 16 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 1069, + "own_seconds": 0.089835 + }, + "nt.lstat": { + "calls": 21425, + "own_seconds": 1.916833 + }, + "nt._getfinalpathname": { + "calls": 2138, + "own_seconds": 0.263897 + }, + "nt._path_lexists": { + "calls": 3077, + "own_seconds": 0.277359 + } + }, + "completed_plans": 11 + }, + { + "repetition": 0, + "retained_claims": 16, + "current_plans": 1, + "setup_seconds": 2.672677, + "validation_wall_seconds": 1.238014, + "validation_cpu_seconds": 1.015625, + "reconcile_wall_seconds": 1.411422, + "reconcile_cpu_seconds": 1.125, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 445, + "_physical_location_key": 169, + "_paths_overlap": 84, + "_path_key": 112, + "_same_physical_path": 32 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 445, + "own_seconds": 0.044984 + }, + "nt.lstat": { + "calls": 6885, + "own_seconds": 0.73424 + }, + "nt._getfinalpathname": { + "calls": 890, + "own_seconds": 0.131944 + }, + "nt._path_lexists": { + "calls": 1201, + "own_seconds": 0.133026 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "setup_seconds": 2.490903, + "validation_wall_seconds": 5.224276, + "validation_cpu_seconds": 4.5625, + "reconcile_wall_seconds": 7.775355, + "reconcile_cpu_seconds": 6.1875, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 2005, + "_physical_location_key": 1539, + "_paths_overlap": 764, + "_path_key": 272, + "_same_physical_path": 32 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 2005, + "own_seconds": 0.157241 + }, + "nt.lstat": { + "calls": 40265, + "own_seconds": 3.234528 + }, + "nt._getfinalpathname": { + "calls": 4010, + "own_seconds": 0.480778 + }, + "nt._path_lexists": { + "calls": 5821, + "own_seconds": 0.480792 + } + }, + "completed_plans": 11 + } + ], + "progress_demo": { + "production_interval_seconds": 5.0, + "production_max_periodic_reports": null, + "nominal_production_cutoff_seconds": null, + "demo_interval_seconds": 0.01, + "periodic_reports": 27, + "claims_at_last_periodic_report": 40, + "claims_at_completion": 40, + "suppression_message_seen": false, + "completion_message_seen": true + } + }, + "combined_prototype_poc_after": { + "os": "Windows", + "python": "3.14.4", + "coordinator_sha256": "87baa64350e2f36223570ce69ee93927a54146a9bcf62031b5ae4e87ab629ac6", + "timings_include_instrumentation": true, + "samples": [ + { + "repetition": 0, + "retained_claims": 0, + "current_plans": 1, + "setup_seconds": 0.037175, + "validation_wall_seconds": 0.014788, + "validation_cpu_seconds": 0.0, + "reconcile_wall_seconds": 0.128856, + "reconcile_cpu_seconds": 0.0625, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 12, + "_windows_file_attributes": 122, + "_physical_location_key": 9, + "_paths_overlap": 4 + }, + "validation_filesystem_calls": { + "windows_attribute_probes": { + "calls": 122, + "own_seconds": 0.004562 + }, + "nt.stat": { + "calls": 12, + "own_seconds": 0.000572 + }, + "nt.lstat": { + "calls": 112, + "own_seconds": 0.004298 + }, + "nt._getfinalpathname": { + "calls": 24, + "own_seconds": 0.001476 + }, + "nt._path_lexists": { + "calls": 20, + "own_seconds": 0.00091 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 0, + "current_plans": 11, + "setup_seconds": 0.122625, + "validation_wall_seconds": 0.165921, + "validation_cpu_seconds": 0.171875, + "reconcile_wall_seconds": 1.829737, + "reconcile_cpu_seconds": 1.421875, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 132, + "_windows_file_attributes": 1342, + "_physical_location_key": 99, + "_paths_overlap": 44 + }, + "validation_filesystem_calls": { + "windows_attribute_probes": { + "calls": 1342, + "own_seconds": 0.052877 + }, + "nt.stat": { + "calls": 132, + "own_seconds": 0.005423 + }, + "nt.lstat": { + "calls": 1232, + "own_seconds": 0.05196 + }, + "nt._getfinalpathname": { + "calls": 264, + "own_seconds": 0.016646 + }, + "nt._path_lexists": { + "calls": 210, + "own_seconds": 0.008911 + } + }, + "completed_plans": 11 + }, + { + "repetition": 0, + "retained_claims": 8, + "current_plans": 1, + "setup_seconds": 0.956424, + "validation_wall_seconds": 0.457757, + "validation_cpu_seconds": 0.34375, + "reconcile_wall_seconds": 0.598668, + "reconcile_cpu_seconds": 0.40625, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 229, + "_windows_file_attributes": 2414, + "_physical_location_key": 89, + "_paths_overlap": 44, + "_path_key": 56, + "_same_physical_path": 16 + }, + "validation_filesystem_calls": { + "windows_attribute_probes": { + "calls": 2414, + "own_seconds": 0.180845 + }, + "nt.stat": { + "calls": 229, + "own_seconds": 0.016608 + }, + "nt.lstat": { + "calls": 1151, + "own_seconds": 0.08977 + }, + "nt._getfinalpathname": { + "calls": 458, + "own_seconds": 0.051807 + }, + "nt._path_lexists": { + "calls": 388, + "own_seconds": 0.030609 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 8, + "current_plans": 11, + "setup_seconds": 1.039364, + "validation_wall_seconds": 2.024616, + "validation_cpu_seconds": 1.6875, + "reconcile_wall_seconds": 4.093077, + "reconcile_cpu_seconds": 3.078125, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 1069, + "_windows_file_attributes": 10844, + "_physical_location_key": 819, + "_paths_overlap": 404, + "_path_key": 136, + "_same_physical_path": 16 + }, + "validation_filesystem_calls": { + "windows_attribute_probes": { + "calls": 10844, + "own_seconds": 0.638409 + }, + "nt.stat": { + "calls": 1069, + "own_seconds": 0.062137 + }, + "nt.lstat": { + "calls": 10581, + "own_seconds": 0.627289 + }, + "nt._getfinalpathname": { + "calls": 2138, + "own_seconds": 0.198272 + }, + "nt._path_lexists": { + "calls": 2008, + "own_seconds": 0.126718 + } + }, + "completed_plans": 11 + }, + { + "repetition": 0, + "retained_claims": 16, + "current_plans": 1, + "setup_seconds": 1.802842, + "validation_wall_seconds": 0.634957, + "validation_cpu_seconds": 0.59375, + "reconcile_wall_seconds": 0.760531, + "reconcile_cpu_seconds": 0.65625, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 445, + "_windows_file_attributes": 4694, + "_physical_location_key": 169, + "_paths_overlap": 84, + "_path_key": 112, + "_same_physical_path": 32 + }, + "validation_filesystem_calls": { + "windows_attribute_probes": { + "calls": 4694, + "own_seconds": 0.238307 + }, + "nt.stat": { + "calls": 445, + "own_seconds": 0.024316 + }, + "nt.lstat": { + "calls": 2191, + "own_seconds": 0.121356 + }, + "nt._getfinalpathname": { + "calls": 890, + "own_seconds": 0.07108 + }, + "nt._path_lexists": { + "calls": 756, + "own_seconds": 0.044677 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "setup_seconds": 1.969252, + "validation_wall_seconds": 4.581015, + "validation_cpu_seconds": 3.8125, + "reconcile_wall_seconds": 6.725737, + "reconcile_cpu_seconds": 5.21875, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 2005, + "_windows_file_attributes": 20324, + "_physical_location_key": 1539, + "_paths_overlap": 764, + "_path_key": 272, + "_same_physical_path": 32 + }, + "validation_filesystem_calls": { + "windows_attribute_probes": { + "calls": 20324, + "own_seconds": 1.438408 + }, + "nt.stat": { + "calls": 2005, + "own_seconds": 0.14439 + }, + "nt.lstat": { + "calls": 19941, + "own_seconds": 1.451434 + }, + "nt._getfinalpathname": { + "calls": 4010, + "own_seconds": 0.432472 + }, + "nt._path_lexists": { + "calls": 3816, + "own_seconds": 0.295758 + } + }, + "completed_plans": 11 + } + ], + "progress_demo": { + "production_interval_seconds": 5.0, + "production_max_periodic_reports": null, + "nominal_production_cutoff_seconds": null, + "demo_interval_seconds": 0.01, + "periodic_reports": 26, + "claims_at_last_periodic_report": 39, + "claims_at_completion": 40, + "suppression_message_seen": false, + "completion_message_seen": true + } + }, + "attribute_ablation_py314": { + "platform": "Windows", + "python": "3.14.4", + "timings_include_instrumentation": true, + "setup_method": "private locked initialization/reconciliation (issue #54 POC)", + "coordinator_sha256": { + "baseline": "0dfdefbf5a66a17094cd6abaa0dfe4d55dde9639574d1440d8c25a7110a96d60", + "candidate": "87baa64350e2f36223570ce69ee93927a54146a9bcf62031b5ae4e87ab629ac6" + }, + "samples": [ + { + "revision": "baseline", + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 1.9255942000309005, + "seed_cpu_seconds": 1.0625, + "validation_wall_seconds": 3.8907204999704845, + "validation_cpu_seconds": 3.5, + "reconcile_wall_seconds": 5.886366199993063, + "reconcile_cpu_seconds": 4.90625, + "lock_wait_wall_seconds": 0.3129801002214663, + "registry_lock_held_wall_seconds": 5.845657699974254, + "current_plan_validation_wall_seconds": 0.6578052999684587, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 3816 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 1.9502744999481365, + "seed_cpu_seconds": 1.28125, + "validation_wall_seconds": 5.352577700046822, + "validation_cpu_seconds": 4.328125, + "reconcile_wall_seconds": 7.426365299965255, + "reconcile_cpu_seconds": 5.59375, + "lock_wait_wall_seconds": 0.22541349980747327, + "registry_lock_held_wall_seconds": 7.404415099998005, + "current_plan_validation_wall_seconds": 0.7058043000288308, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "windows_attribute_probes": 22329, + "nt.stat": 2005, + "nt.lstat": 21480, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 3816 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 1, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.471324199985247, + "seed_cpu_seconds": 1.5625, + "validation_wall_seconds": 3.514202899998054, + "validation_cpu_seconds": 3.234375, + "reconcile_wall_seconds": 6.003659999987576, + "reconcile_cpu_seconds": 4.8125, + "lock_wait_wall_seconds": 0.44804170000134036, + "registry_lock_held_wall_seconds": 5.979545499954838, + "current_plan_validation_wall_seconds": 0.9495452999835834, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "windows_attribute_probes": 22329, + "nt.stat": 2005, + "nt.lstat": 21480, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 3816 + }, + "completed_plans": 11 + }, + { + "revision": "baseline", + "repetition": 1, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.360893000033684, + "seed_cpu_seconds": 1.40625, + "validation_wall_seconds": 4.542891199991573, + "validation_cpu_seconds": 4.171875, + "reconcile_wall_seconds": 6.766588699945714, + "reconcile_cpu_seconds": 5.859375, + "lock_wait_wall_seconds": 0.2927765001077205, + "registry_lock_held_wall_seconds": 6.73910419997992, + "current_plan_validation_wall_seconds": 0.8883354000281543, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 3816 + }, + "completed_plans": 11 + }, + { + "revision": "baseline", + "repetition": 2, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.1543265000218526, + "seed_cpu_seconds": 1.234375, + "validation_wall_seconds": 3.403330700006336, + "validation_cpu_seconds": 3.21875, + "reconcile_wall_seconds": 5.410496700031217, + "reconcile_cpu_seconds": 4.71875, + "lock_wait_wall_seconds": 0.27812690002610907, + "registry_lock_held_wall_seconds": 5.383742100035306, + "current_plan_validation_wall_seconds": 0.7689135000109673, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 3816 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 2, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.039945499971509, + "seed_cpu_seconds": 1.296875, + "validation_wall_seconds": 3.9925649000215344, + "validation_cpu_seconds": 3.78125, + "reconcile_wall_seconds": 5.979028500034474, + "reconcile_cpu_seconds": 5.1875, + "lock_wait_wall_seconds": 0.25394970015622675, + "registry_lock_held_wall_seconds": 5.954361899988726, + "current_plan_validation_wall_seconds": 0.7750130000058562, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "windows_attribute_probes": 22329, + "nt.stat": 2005, + "nt.lstat": 21480, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 3816 + }, + "completed_plans": 11 + } + ], + "medians": [ + { + "retained_claims": 16, + "current_plans": 11, + "baseline": { + "seed_wall_seconds": 2.1543265000218526, + "seed_cpu_seconds": 1.234375, + "validation_wall_seconds": 3.8907204999704845, + "validation_cpu_seconds": 3.5, + "reconcile_wall_seconds": 5.886366199993063, + "reconcile_cpu_seconds": 4.90625, + "lock_wait_wall_seconds": 0.2927765001077205, + "registry_lock_held_wall_seconds": 5.845657699974254, + "current_plan_validation_wall_seconds": 0.7689135000109673, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039 + }, + "candidate": { + "seed_wall_seconds": 2.039945499971509, + "seed_cpu_seconds": 1.296875, + "validation_wall_seconds": 3.9925649000215344, + "validation_cpu_seconds": 3.78125, + "reconcile_wall_seconds": 6.003659999987576, + "reconcile_cpu_seconds": 5.1875, + "lock_wait_wall_seconds": 0.25394970015622675, + "registry_lock_held_wall_seconds": 5.979545499954838, + "current_plan_validation_wall_seconds": 0.7750130000058562, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039 + }, + "wall_time_reduction_percent": -1.9926351166302148 + } + ] + }, + "attribute_ablation_py312": { + "platform": "Windows", + "python": "3.12.9", + "timings_include_instrumentation": true, + "setup_method": "private locked initialization/reconciliation (issue #54 POC)", + "coordinator_sha256": { + "baseline": "0dfdefbf5a66a17094cd6abaa0dfe4d55dde9639574d1440d8c25a7110a96d60", + "candidate": "87baa64350e2f36223570ce69ee93927a54146a9bcf62031b5ae4e87ab629ac6" + }, + "samples": [ + { + "revision": "baseline", + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 1.9380826000124216, + "seed_cpu_seconds": 1.046875, + "validation_wall_seconds": 3.8743141999584623, + "validation_cpu_seconds": 3.328125, + "reconcile_wall_seconds": 5.991393300006166, + "reconcile_cpu_seconds": 4.734375, + "lock_wait_wall_seconds": 0.28451779996976256, + "registry_lock_held_wall_seconds": 5.964167799975257, + "current_plan_validation_wall_seconds": 0.8961926000192761, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 45830, + "nt.lstat": 3816, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.012949399999343, + "seed_cpu_seconds": 1.21875, + "validation_wall_seconds": 3.7962633999995887, + "validation_cpu_seconds": 3.421875, + "reconcile_wall_seconds": 5.672135500004515, + "reconcile_cpu_seconds": 4.75, + "lock_wait_wall_seconds": 0.2546841001021676, + "registry_lock_held_wall_seconds": 5.642989900021348, + "current_plan_validation_wall_seconds": 0.6838864999590442, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "windows_attribute_probes": 22329, + "nt.stat": 23501, + "nt.lstat": 3816, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 1, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.039824499981478, + "seed_cpu_seconds": 1.265625, + "validation_wall_seconds": 3.449085699976422, + "validation_cpu_seconds": 3.125, + "reconcile_wall_seconds": 5.33054929994978, + "reconcile_cpu_seconds": 4.421875, + "lock_wait_wall_seconds": 0.24748950003413484, + "registry_lock_held_wall_seconds": 5.306947000033688, + "current_plan_validation_wall_seconds": 0.7296249000355601, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "windows_attribute_probes": 22329, + "nt.stat": 23501, + "nt.lstat": 3816, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + }, + { + "revision": "baseline", + "repetition": 1, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.1450219999533147, + "seed_cpu_seconds": 1.359375, + "validation_wall_seconds": 3.456297299999278, + "validation_cpu_seconds": 3.3125, + "reconcile_wall_seconds": 5.434559200017247, + "reconcile_cpu_seconds": 4.75, + "lock_wait_wall_seconds": 0.25926460011396557, + "registry_lock_held_wall_seconds": 5.409031699993648, + "current_plan_validation_wall_seconds": 0.7916680000489578, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 45830, + "nt.lstat": 3816, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + }, + { + "revision": "baseline", + "repetition": 2, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.1303489999845624, + "seed_cpu_seconds": 1.203125, + "validation_wall_seconds": 4.043143099988811, + "validation_cpu_seconds": 3.71875, + "reconcile_wall_seconds": 6.259159700013697, + "reconcile_cpu_seconds": 5.3125, + "lock_wait_wall_seconds": 0.24932060012361035, + "registry_lock_held_wall_seconds": 6.231611900031567, + "current_plan_validation_wall_seconds": 1.0439072999870405, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 45830, + "nt.lstat": 3816, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 2, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.072428699990269, + "seed_cpu_seconds": 1.390625, + "validation_wall_seconds": 3.7062581999925897, + "validation_cpu_seconds": 3.421875, + "reconcile_wall_seconds": 5.67605279997224, + "reconcile_cpu_seconds": 4.875, + "lock_wait_wall_seconds": 0.26414589991327375, + "registry_lock_held_wall_seconds": 5.65008199994918, + "current_plan_validation_wall_seconds": 0.7793610999942757, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "windows_attribute_probes": 22329, + "nt.stat": 23501, + "nt.lstat": 3816, + "nt._getfinalpathname": 4010 + }, + "completed_plans": 11 + } + ], + "medians": [ + { + "retained_claims": 16, + "current_plans": 11, + "baseline": { + "seed_wall_seconds": 2.1303489999845624, + "seed_cpu_seconds": 1.203125, + "validation_wall_seconds": 3.8743141999584623, + "validation_cpu_seconds": 3.328125, + "reconcile_wall_seconds": 5.991393300006166, + "reconcile_cpu_seconds": 4.75, + "lock_wait_wall_seconds": 0.25926460011396557, + "registry_lock_held_wall_seconds": 5.964167799975257, + "current_plan_validation_wall_seconds": 0.8961926000192761, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039 + }, + "candidate": { + "seed_wall_seconds": 2.039824499981478, + "seed_cpu_seconds": 1.265625, + "validation_wall_seconds": 3.7062581999925897, + "validation_cpu_seconds": 3.421875, + "reconcile_wall_seconds": 5.672135500004515, + "reconcile_cpu_seconds": 4.75, + "lock_wait_wall_seconds": 0.2546841001021676, + "registry_lock_held_wall_seconds": 5.642989900021348, + "current_plan_validation_wall_seconds": 0.7296249000355601, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039 + }, + "wall_time_reduction_percent": 5.328606953599968 + } + ] + }, + "combined_prototype_pilot": { + "platform": "Windows", + "python": "3.14.4", + "timings_include_instrumentation": true, + "setup_method": "private locked initialization/reconciliation (issue #54 POC)", + "coordinator_sha256": { + "candidate": "87baa64350e2f36223570ce69ee93927a54146a9bcf62031b5ae4e87ab629ac6" + }, + "samples": [ + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 64, + "current_plans": 11, + "seed_wall_seconds": 8.998478900000919, + "seed_cpu_seconds": 5.4375, + "validation_wall_seconds": 15.910631000006106, + "validation_cpu_seconds": 13.40625, + "reconcile_wall_seconds": 17.71092879999196, + "reconcile_cpu_seconds": 14.71875, + "lock_wait_wall_seconds": 0.23102169996127486, + "registry_lock_held_wall_seconds": 17.686536199995317, + "current_plan_validation_wall_seconds": 0.6708469999721274, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 64, + "path_projections_in_validation": 7621, + "path_projections_total": 8655, + "validation_filesystem_calls": { + "windows_attribute_probes": 84825, + "nt.stat": 7621, + "nt.lstat": 81960, + "nt._getfinalpathname": 15242, + "nt._path_lexists": 14664 + }, + "completed_plans": 11 + } + ], + "medians": [ + { + "retained_claims": 64, + "current_plans": 11, + "candidate": { + "seed_wall_seconds": 8.998478900000919, + "seed_cpu_seconds": 5.4375, + "validation_wall_seconds": 15.910631000006106, + "validation_cpu_seconds": 13.40625, + "reconcile_wall_seconds": 17.71092879999196, + "reconcile_cpu_seconds": 14.71875, + "lock_wait_wall_seconds": 0.23102169996127486, + "registry_lock_held_wall_seconds": 17.686536199995317, + "current_plan_validation_wall_seconds": 0.6708469999721274, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 64, + "path_projections_in_validation": 7621, + "path_projections_total": 8655 + } + } + ] + }, + "final_comparison_py314": { + "platform": "Windows", + "python": "3.14.4", + "timings_include_instrumentation": true, + "setup_method": "private locked initialization/reconciliation (issue #54 POC)", + "coordinator_sha256": { + "baseline": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5", + "candidate": "1b0fb79eae89041c2b4949c713ec66d8d18e28941780a6652ddd6fb619b2bf87" + }, + "samples": [ + { + "revision": "baseline", + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 1.9012400999781676, + "seed_cpu_seconds": 0.9375, + "validation_wall_seconds": 3.637544600002002, + "validation_cpu_seconds": 3.25, + "reconcile_wall_seconds": 5.6222387999878265, + "reconcile_cpu_seconds": 4.546875, + "lock_wait_wall_seconds": 0.24277469993103296, + "registry_lock_held_wall_seconds": 5.599385600013193, + "current_plan_validation_wall_seconds": 0.7571722000138834, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 5821 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.217794900003355, + "seed_cpu_seconds": 1.28125, + "validation_wall_seconds": 3.3006663999985904, + "validation_cpu_seconds": 3.078125, + "reconcile_wall_seconds": 5.230336899985559, + "reconcile_cpu_seconds": 4.34375, + "lock_wait_wall_seconds": 0.2811884998809546, + "registry_lock_held_wall_seconds": 5.200107700016815, + "current_plan_validation_wall_seconds": 0.73309860000154, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 3816 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 1, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 1.8777578000444919, + "seed_cpu_seconds": 1.21875, + "validation_wall_seconds": 3.6942081000306644, + "validation_cpu_seconds": 3.4375, + "reconcile_wall_seconds": 5.43478499999037, + "reconcile_cpu_seconds": 4.921875, + "lock_wait_wall_seconds": 0.2296658999985084, + "registry_lock_held_wall_seconds": 5.412625700002536, + "current_plan_validation_wall_seconds": 0.6629222999908961, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 3816 + }, + "completed_plans": 11 + }, + { + "revision": "baseline", + "repetition": 1, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.1699746000231244, + "seed_cpu_seconds": 1.40625, + "validation_wall_seconds": 2.9540651999996044, + "validation_cpu_seconds": 2.796875, + "reconcile_wall_seconds": 5.100353600049857, + "reconcile_cpu_seconds": 4.046875, + "lock_wait_wall_seconds": 0.24302340002031997, + "registry_lock_held_wall_seconds": 5.073960600013379, + "current_plan_validation_wall_seconds": 0.6219252000446431, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 5821 + }, + "completed_plans": 11 + }, + { + "revision": "baseline", + "repetition": 2, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.3346471000113524, + "seed_cpu_seconds": 1.265625, + "validation_wall_seconds": 3.3979147000354715, + "validation_cpu_seconds": 3.125, + "reconcile_wall_seconds": 5.39498589996947, + "reconcile_cpu_seconds": 4.375, + "lock_wait_wall_seconds": 0.26571340003283694, + "registry_lock_held_wall_seconds": 5.368466199957766, + "current_plan_validation_wall_seconds": 0.706326799991075, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 5821 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 2, + "retained_claims": 16, + "current_plans": 11, + "seed_wall_seconds": 2.2180932000046596, + "seed_cpu_seconds": 1.15625, + "validation_wall_seconds": 3.4051751000224613, + "validation_cpu_seconds": 3.171875, + "reconcile_wall_seconds": 5.397862699988764, + "reconcile_cpu_seconds": 4.578125, + "lock_wait_wall_seconds": 0.32739230000879616, + "registry_lock_held_wall_seconds": 5.362985200015828, + "current_plan_validation_wall_seconds": 0.7317626000149176, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039, + "validation_filesystem_calls": { + "nt.stat": 2005, + "nt.lstat": 43809, + "nt._getfinalpathname": 4010, + "nt._path_lexists": 3816 + }, + "completed_plans": 11 + } + ], + "medians": [ + { + "retained_claims": 16, + "current_plans": 11, + "baseline": { + "seed_wall_seconds": 2.1699746000231244, + "seed_cpu_seconds": 1.265625, + "validation_wall_seconds": 3.3979147000354715, + "validation_cpu_seconds": 3.125, + "reconcile_wall_seconds": 5.39498589996947, + "reconcile_cpu_seconds": 4.375, + "lock_wait_wall_seconds": 0.24302340002031997, + "registry_lock_held_wall_seconds": 5.368466199957766, + "current_plan_validation_wall_seconds": 0.706326799991075, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039 + }, + "candidate": { + "seed_wall_seconds": 2.217794900003355, + "seed_cpu_seconds": 1.21875, + "validation_wall_seconds": 3.4051751000224613, + "validation_cpu_seconds": 3.171875, + "reconcile_wall_seconds": 5.397862699988764, + "reconcile_cpu_seconds": 4.578125, + "lock_wait_wall_seconds": 0.2811884998809546, + "registry_lock_held_wall_seconds": 5.362985200015828, + "current_plan_validation_wall_seconds": 0.7317626000149176, + "registry_validations": 1, + "registry_scans": 1, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 2005, + "path_projections_total": 3039 + }, + "wall_time_reduction_percent": -0.053323587357478885 + } + ] + }, + "final_poc_py312_before": { + "os": "Windows", + "python": "3.12.9", + "coordinator_sha256": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5", + "timings_include_instrumentation": true, + "samples": [ + { + "repetition": 0, + "retained_claims": 0, + "current_plans": 1, + "setup_seconds": 0.034574, + "validation_wall_seconds": 0.018927, + "validation_cpu_seconds": 0.015625, + "reconcile_wall_seconds": 0.139053, + "reconcile_cpu_seconds": 0.078125, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 12, + "_physical_location_key": 9, + "_paths_overlap": 4 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 246, + "own_seconds": 0.011919 + }, + "nt.lstat": { + "calls": 32, + "own_seconds": 0.001631 + }, + "nt._getfinalpathname": { + "calls": 24, + "own_seconds": 0.001635 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 0, + "current_plans": 11, + "setup_seconds": 0.131974, + "validation_wall_seconds": 0.231105, + "validation_cpu_seconds": 0.21875, + "reconcile_wall_seconds": 2.223823, + "reconcile_cpu_seconds": 1.5625, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 132, + "_physical_location_key": 99, + "_paths_overlap": 44 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 2706, + "own_seconds": 0.152611 + }, + "nt.lstat": { + "calls": 342, + "own_seconds": 0.019535 + }, + "nt._getfinalpathname": { + "calls": 264, + "own_seconds": 0.021596 + } + }, + "completed_plans": 11 + }, + { + "repetition": 0, + "retained_claims": 8, + "current_plans": 1, + "setup_seconds": 1.148487, + "validation_wall_seconds": 0.340102, + "validation_cpu_seconds": 0.328125, + "reconcile_wall_seconds": 0.464592, + "reconcile_cpu_seconds": 0.390625, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 229, + "_physical_location_key": 89, + "_paths_overlap": 44, + "_path_key": 56, + "_same_physical_path": 16 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 3802, + "own_seconds": 0.193532 + }, + "nt.lstat": { + "calls": 617, + "own_seconds": 0.035867 + }, + "nt._getfinalpathname": { + "calls": 458, + "own_seconds": 0.03869 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 8, + "current_plans": 11, + "setup_seconds": 1.310114, + "validation_wall_seconds": 2.270882, + "validation_cpu_seconds": 1.90625, + "reconcile_wall_seconds": 4.557809, + "reconcile_cpu_seconds": 3.328125, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 1069, + "_physical_location_key": 819, + "_paths_overlap": 404, + "_path_key": 136, + "_same_physical_path": 16 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 22502, + "own_seconds": 1.451911 + }, + "nt.lstat": { + "calls": 3077, + "own_seconds": 0.215745 + }, + "nt._getfinalpathname": { + "calls": 2138, + "own_seconds": 0.208045 + } + }, + "completed_plans": 11 + }, + { + "repetition": 0, + "retained_claims": 16, + "current_plans": 1, + "setup_seconds": 2.18809, + "validation_wall_seconds": 0.634299, + "validation_cpu_seconds": 0.59375, + "reconcile_wall_seconds": 0.750014, + "reconcile_cpu_seconds": 0.65625, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 445, + "_physical_location_key": 169, + "_paths_overlap": 84, + "_path_key": 112, + "_same_physical_path": 32 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 7346, + "own_seconds": 0.362104 + }, + "nt.lstat": { + "calls": 1201, + "own_seconds": 0.070489 + }, + "nt._getfinalpathname": { + "calls": 890, + "own_seconds": 0.069402 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "setup_seconds": 2.271851, + "validation_wall_seconds": 3.276213, + "validation_cpu_seconds": 2.96875, + "reconcile_wall_seconds": 5.034528, + "reconcile_cpu_seconds": 4.171875, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 2005, + "_physical_location_key": 1539, + "_paths_overlap": 764, + "_path_key": 272, + "_same_physical_path": 32 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 42286, + "own_seconds": 2.008382 + }, + "nt.lstat": { + "calls": 5821, + "own_seconds": 0.30235 + }, + "nt._getfinalpathname": { + "calls": 4010, + "own_seconds": 0.307191 + } + }, + "completed_plans": 11 + } + ], + "progress_demo": { + "production_interval_seconds": 5.0, + "production_max_periodic_reports": null, + "nominal_production_cutoff_seconds": null, + "demo_interval_seconds": 0.01, + "periodic_reports": 26, + "claims_at_last_periodic_report": 40, + "claims_at_completion": 40, + "suppression_message_seen": false, + "completion_message_seen": true + } + }, + "final_poc_py312_after": { + "os": "Windows", + "python": "3.12.9", + "coordinator_sha256": "1b0fb79eae89041c2b4949c713ec66d8d18e28941780a6652ddd6fb619b2bf87", + "timings_include_instrumentation": true, + "samples": [ + { + "repetition": 0, + "retained_claims": 0, + "current_plans": 1, + "setup_seconds": 0.034141, + "validation_wall_seconds": 0.020479, + "validation_cpu_seconds": 0.03125, + "reconcile_wall_seconds": 0.142527, + "reconcile_cpu_seconds": 0.046875, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 12, + "_physical_location_key": 9, + "_paths_overlap": 4 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 246, + "own_seconds": 0.013582 + }, + "nt.lstat": { + "calls": 20, + "own_seconds": 0.00147 + }, + "nt._getfinalpathname": { + "calls": 24, + "own_seconds": 0.001886 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 0, + "current_plans": 11, + "setup_seconds": 0.147965, + "validation_wall_seconds": 0.219711, + "validation_cpu_seconds": 0.203125, + "reconcile_wall_seconds": 2.226259, + "reconcile_cpu_seconds": 1.421875, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 132, + "_physical_location_key": 99, + "_paths_overlap": 44 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 2706, + "own_seconds": 0.147649 + }, + "nt.lstat": { + "calls": 210, + "own_seconds": 0.01315 + }, + "nt._getfinalpathname": { + "calls": 264, + "own_seconds": 0.022254 + } + }, + "completed_plans": 11 + }, + { + "repetition": 0, + "retained_claims": 8, + "current_plans": 1, + "setup_seconds": 1.122367, + "validation_wall_seconds": 0.531479, + "validation_cpu_seconds": 0.390625, + "reconcile_wall_seconds": 0.721315, + "reconcile_cpu_seconds": 0.515625, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 229, + "_physical_location_key": 89, + "_paths_overlap": 44, + "_path_key": 56, + "_same_physical_path": 16 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 3802, + "own_seconds": 0.344879 + }, + "nt.lstat": { + "calls": 388, + "own_seconds": 0.040039 + }, + "nt._getfinalpathname": { + "calls": 458, + "own_seconds": 0.055577 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 8, + "current_plans": 11, + "setup_seconds": 1.292445, + "validation_wall_seconds": 1.848543, + "validation_cpu_seconds": 1.59375, + "reconcile_wall_seconds": 3.941495, + "reconcile_cpu_seconds": 2.921875, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 1069, + "_physical_location_key": 819, + "_paths_overlap": 404, + "_path_key": 136, + "_same_physical_path": 16 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 22502, + "own_seconds": 1.178229 + }, + "nt.lstat": { + "calls": 2008, + "own_seconds": 0.122756 + }, + "nt._getfinalpathname": { + "calls": 2138, + "own_seconds": 0.180689 + } + }, + "completed_plans": 11 + }, + { + "repetition": 0, + "retained_claims": 16, + "current_plans": 1, + "setup_seconds": 1.849587, + "validation_wall_seconds": 0.598632, + "validation_cpu_seconds": 0.546875, + "reconcile_wall_seconds": 0.714918, + "reconcile_cpu_seconds": 0.609375, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 445, + "_physical_location_key": 169, + "_paths_overlap": 84, + "_path_key": 112, + "_same_physical_path": 32 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 7346, + "own_seconds": 0.353687 + }, + "nt.lstat": { + "calls": 756, + "own_seconds": 0.045329 + }, + "nt._getfinalpathname": { + "calls": 890, + "own_seconds": 0.067144 + } + }, + "completed_plans": 1 + }, + { + "repetition": 0, + "retained_claims": 16, + "current_plans": 11, + "setup_seconds": 2.052384, + "validation_wall_seconds": 3.416418, + "validation_cpu_seconds": 2.96875, + "reconcile_wall_seconds": 5.177469, + "reconcile_cpu_seconds": 4.046875, + "validation_operation_counts": { + "registry_validations": 1, + "project_path": 2005, + "_physical_location_key": 1539, + "_paths_overlap": 764, + "_path_key": 272, + "_same_physical_path": 32 + }, + "validation_filesystem_calls": { + "nt.stat": { + "calls": 42286, + "own_seconds": 2.212539 + }, + "nt.lstat": { + "calls": 3816, + "own_seconds": 0.227172 + }, + "nt._getfinalpathname": { + "calls": 4010, + "own_seconds": 0.323864 + } + }, + "completed_plans": 11 + } + ], + "progress_demo": { + "production_interval_seconds": 5.0, + "production_max_periodic_reports": null, + "nominal_production_cutoff_seconds": null, + "demo_interval_seconds": 0.01, + "periodic_reports": 26, + "claims_at_last_periodic_report": 40, + "claims_at_completion": 40, + "suppression_message_seen": false, + "completion_message_seen": true + } + } + } +} diff --git a/docs/registry-validation-results.md b/docs/registry-validation-results.md new file mode 100644 index 0000000..e1c9aea --- /dev/null +++ b/docs/registry-validation-results.md @@ -0,0 +1,153 @@ +# Registry validation results (#54) + +These measurements cover the first implementation. The [subsequent optimization +review](registry-validation-refinements.md) records further experiments, the +final retained refinement and its verification. Historical samples remain intact. + +The architecture proposal is in [registry-validation-design.md](registry-validation-design.md). +This is a bounded reduction in physical metadata work, preserving fresh +observations for every comparison. The retained-claim/current-plan cross product +and all path projections remain. It does not claim sublinear registry validation. +Full sanitized samples are in [registry-validation-results.json](registry-validation-results.json). + +## Method and source identity + +Windows, CPython 3.14.4; instrumented local measurements. Baseline is the local +coordinator before this change, with the exact LF-normalized SHA-256 reported +in #54 (`2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85`). +No historical checkout reset was needed. Every sample has a new isolated +synthetic registry. Setup uses real private locked initialization/reconciliation; +the measured operation is normal `reconcile_set((), current)`, with all checks +and filesystem calls delegated unchanged. Setup is excluded from validation. +No generated payloads, shared consumer registry or network are involved. + +The issue POC is retained at `tests/registry_validation_poc.py`. Its sample +method is unchanged; progress metadata tolerates the removed lifetime cap, +and the encoding lambda was converted to a function for lint. Repository +formatting also changes presentation without changing the measurement. The +original script remains embedded in issue #54. Both initial matrices used that +original script before those presentation/metadata adaptations. The initial +candidate temporarily retained `MAX_REPORTS` solely as legacy POC metadata; it +was already ignored by the reporting loop. Thus that original candidate JSON's +nominal cutoff field is legacy metadata, not an actual cutoff (26 reports were +observed). The final implementation removes the constant entirely. + +The reusable benchmark now profiles filesystem calls, restores instrumentation +in `finally`, rejects reused sample directories, and supports explicit `--large` +workloads up to 4,096 claims/32 plans. Private seeding avoids quadratic setup +validation, matching the POC; measured reconciliation never skips validation. +`seed_wall_seconds` now includes fixture plan creation. `lock_wait_wall_seconds` +includes preparing and acquiring all lock files (excluding key derivation +between calls); it is not pure kernel blocking. +`registry_lock_held_wall_seconds` measures acquisition to release directly. +Current-plan all-pairs validation is timed outside registry-validation profiling. + +## Original POC matrix + +Single descriptive samples; caches and concurrent workstation activity were not +controlled. All twelve operations completed. Counts combine `nt.stat` and +`nt.lstat`; Python versions can move calls between those two categories. + +| Claims / plans | Baseline validation s | Candidate validation s | Baseline stat+lstat | Candidate stat+lstat | Projections (both) | +| --- | ---: | ---: | ---: | ---: | ---: | +| 0 / 1 | 0.046 | 0.029 | 381 | 246 | 12 | +| 0 / 11 | 0.379 | 0.256 | 4,191 | 2,706 | 132 | +| 8 / 1 | 0.328 | 0.675 | 4,899 | 3,794 | 229 | +| 8 / 11 | 2.212 | 2.098 | 32,729 | 22,494 | 1,069 | +| 16 / 1 | 0.632 | 0.593 | 9,395 | 7,330 | 445 | +| 16 / 11 | 4.094 | 3.674 | 61,145 | 42,270 | 2,005 | + +The 8/1 sample was slower despite fewer probes: single-run wall times are not +a performance gate. The POC's timed validation includes JSON loading, claim/plan +authentication and all comparisons. No JSON or unrelated-claim checks are removed. +Final-path resolutions at 16/11 remain 4,010; projections still dominate much +of the remaining work. Filesystem counts establish the reduced work more reliably +than these timings. + +## Alternating comparison and lock occupancy + +Three alternating baseline/candidate samples, 16 claims/11 plans, with the +maintained benchmark and equal path depth: + +| Measurement | Baseline median | Candidate median | +| --- | ---: | ---: | +| Registry validation | 6.719 s | 4.552 s | +| Validation CPU | 5.438 s | 3.875 s | +| Total reconciliation | 10.468 s | 7.623 s | +| Setup (includes plan creation) | 3.143 s | 2.741 s | +| Registry scans | 1 | 1 | +| Recorded-plan loads during validation | 16 | 16 | +| Projections during validation | 2,005 | 2,005 | +| Validation stat+lstat | 66,272 | 45,814 | + +This is 32.3% lower median registry-validation time and 27.2% lower total time. +Different path depths explain filesystem-count differences from the POC matrix. +One additional pair with direct lock instrumentation measured registry occupancy +7.090 s → 5.586 s, registry validation 4.787 s → 3.575 s, current-plan validation +1.075 s → 0.746 s, and lock acquisition/preparation 0.239 s → 0.273 s. +These are local descriptive results, not a CI timing guarantee. + +## Larger workload and progress + +The 64-claim/11-plan pilot completed with 9.023 s setup, 12.342 s registry +validation and 14.398 s reconciliation. It scanned once, loaded 64 recorded +plans, projected 7,621 paths, and made 174,406 stat+lstat calls. + +The capped 1,024-claim/11-plan run completed: 136.632 s setup, 220.612 s registry +validation (198.672 s CPU), 0.670 s current-plan validation, 222.487 s total +reconciliation, 222.463 s registry-lock occupancy and 0.246 s lock acquisition/ +preparation. It scanned once, loaded all 1,024 recorded plans, projected 119,941 +paths and made 2,746,246 stat+lstat calls plus 239,882 final-path resolutions. +All 11 plans completed. Production progress continued at 65, 120 and 220 seconds +and ended with 1,024/1,024 claims checked. No 2,048-claim or original consumer +benchmark is claimed. This is a completion/scaling sample, not a large baseline +comparison or evidence that the remaining scaling cost is solved. + +The original accelerated POC observed twelve periodic reports and suppression +at baseline. The candidate produced 26 periodic reports through claim 39/40, +no suppression, and a completion message. Scheduling affects the exact count. +Production remains at five-second frequency for the entire operation. Focused +tests also exercise the actual reporter loop beyond twelve intervals without +wall-clock sleeps, while keeping stdout clean and phase/count/timing fields. +The final maintained-POC smoke run confirms null lifetime-cap/cutoff metadata, +26 periodic reports, no suppression and successful completion. + +## Safety and remaining limits + +Claim format, ownership binding, lock ordering/lifetime, reset and crash recovery, +mutation-time path checks and publication transactions are unchanged. Non-following +directory identity replaces `samefile`'s redundant following probes inside +physical containment only. Other uses of `samefile` remain. Alias simulations now +provide matching directory identities as actual physical aliases do. No identity +observations escape one directional comparison; reverse checks remain fresh. + +Filesystem metadata work is linear in ancestry depth within each direction; +materializing missing-suffix tuple prefixes still has quadratic worst-case +Python copying cost in missing depth. Registry cost remains proportional to +retained claims times current plans/targets; large registries can still take +minutes. Arbitrary external topology mutation is not frozen by registry locks. +A future index needs a separately reviewed topology-invalidation design. + +The isolation audit found older default-selector CMake fixtures. They now receive +a per-test cache base, shared across that test's build trees, with a focused +selector regression. Existing explicit lock-root fixtures retain their choice. +No retained shared claims were inspected, classified as stale or removed. +Only sanitized result JSON is suitable for publication; synthetic fixture +directories and raw logs remain ignored and private. + +## Verification + +- `python -m pytest -q -n 4`: **1,721 passed, 41 skipped** (82.44 s), including + coordinator recovery, concurrent writers, alias/ownership and adversarial + topology checks plus the new metadata/progress regressions. +- `ruff check src tests cmake/ProtocyteOutputCoordinator.py`: passed. +- `python -m pytest -q -m cmake_integration tests/test_output_coordinator_cmake.py`: + **16 passed, 1 skipped** (64.25 s), including default-registry isolation, + lock-wait progress forwarding, recovery and competing-build rejection. +- `git diff --check`: passed. +- The original POC matrix, three alternating comparison pairs, direct lock + occupancy pair, 64-claim pilot and capped 1,024-claim run all completed. +- The maintained POC smoke run completed with the final reporter API. + +No C++ files were changed. Cross-platform execution and 2,048+ claim measurements +remain outside this run; timings are not inferred for those cases. diff --git a/docs/wiki/Contributing.md b/docs/wiki/Contributing.md index 9e4ce89..d3798d9 100644 --- a/docs/wiki/Contributing.md +++ b/docs/wiki/Contributing.md @@ -64,8 +64,11 @@ python tests/benchmark_output_registry.py --claims 0 8 16 --plans 1 4 --repeat 3 It creates each retained claim through the real coordinator in a fresh private registry and reports seed, registry validation, and reconciliation wall/CPU times -separately. It also counts registry scans, recorded-plan loads, and path -projections. It does not generate C++, use the shared registry, or access the +separately. Setup includes plan creation and uses real initialization/reconciliation +helpers under private registry/generation/publication locks; it avoids an +all-pairs setup scan. The measured `reconcile_set` performs every production +check unchanged. It counts registry scans, recorded-plan loads, path projections, +and profiled filesystem calls. It does not generate C++, use the shared registry, or access the network. The printed temporary directory retains the synthetic state and `results.json`; use `--work NEW_DIRECTORY` to choose that directory explicitly. @@ -75,6 +78,24 @@ sample and median times. Compare operation counts as well as wall times: Windows filesystem probes, path depth, caching, and concurrent machine activity affect timings. The focused regression tests are in `tests/test_output_coordinator.py`. +Filesystem counters include native existence queries on newer Windows Python. +Attribute probes from experimental compared sources are counted separately: +substituting a cheaper query must not be reported as eliminating an observation. + +For a larger sample, explicitly opt in (up to 4,096 claims and 32 plans): + +```bash +python tests/benchmark_output_registry.py --large --claims 2048 --plans 11 --repeat 1 +``` + +Start with 64 claims to estimate cost; large setup and validation may take +minutes. The original issue #54 measurement is also available as +`tests/registry_validation_poc.py`. Publish only scripts and sanitized results; +synthetic fixture records contain local paths and must remain private. CMake +pytest fixtures use a per-test cache base even when exercising the default +registry selector. Retained claims are released only by an ownership-aware +reset, never by age, missing build trees or test-looking names. + ## Documentation The canonical wiki source is `docs/wiki/` in the main repository. Edit and diff --git a/docs/wiki/Troubleshooting.md b/docs/wiki/Troubleshooting.md index 830d902..43a1c9f 100644 --- a/docs/wiki/Troubleshooting.md +++ b/docs/wiki/Troubleshooting.md @@ -202,7 +202,8 @@ progress on standard error. It distinguishes waiting for registry, generation, o publication locks from current-plan validation, registry validation, and output reconciliation. Lines include plan/claim counts and elapsed phase times, without consumer paths or claim tokens. Fast operations remain silent; long operations -emit at most twelve progress lines and one completion or failure summary. A lock +emit progress every five seconds until completion, followed by one completion +or failure summary. A lock wait includes preparing and acquiring its lock files. `registry_entries` counts state directories, including any abandoned initialization directories encountered; `claims_checked` counts authenticated claim/plan records. diff --git a/tests/benchmark_output_registry.py b/tests/benchmark_output_registry.py index 260240f..b82c25e 100644 --- a/tests/benchmark_output_registry.py +++ b/tests/benchmark_output_registry.py @@ -18,11 +18,13 @@ from __future__ import annotations import argparse +import cProfile import hashlib import importlib.util import json import os import platform +import pstats import statistics import sys import tempfile @@ -70,12 +72,24 @@ def encode(value: Path | str) -> str: def _sample(module: ModuleType, work: Path, claims: int, plans: int) -> dict[str, Any]: + wall, cpu = time.perf_counter(), time.process_time() + work.mkdir(parents=True, exist_ok=False) engine = module.OutputCoordinator(work / "isolated-registry") retained = [_plan(module, work, f"retained-{i:04}") for i in range(claims)] current = [_plan(module, work, f"current-{i:04}") for i in range(plans)] - wall, cpu = time.perf_counter(), time.process_time() - if retained: - engine.reconcile_set((), retained) + # Setup only, as in issue #54's POC. Seed disjoint synthetic fixtures through + # the real private locked helpers, avoiding all-pairs fixture validation. + # The measured reconcile_set below is unchanged and skips no checks. + module._durable_mkdir(engine.lock_root) + with module.FileLock(engine.lock_root / "registry.lock"): + for plan in retained: + with ( + module.FileLock(engine._generation_lock(plan.root)), + module.FileLock(engine._publication_lock(plan.root)), + ): + state = engine._state_directory(plan.root) + engine._initialize_claim_locked(state, plan) + engine._reconcile_locked(state, plan) seed_wall = time.perf_counter() - wall seed_cpu = time.process_time() - cpu counts = { @@ -86,20 +100,51 @@ def _sample(module: ModuleType, work: Path, claims: int, plans: int) -> dict[str "path_projections_total": 0, } active = False + profile = cProfile.Profile() validation_wall = validation_cpu = 0.0 original_validate = engine._validate_registry original_load = engine._load_recorded_plan original_project = module.project_path original_scandir = module.os.scandir + original_lock = module.FileLock + original_current_validate = engine._validate_plan_set + lock_wait = registry_held = current_validation = 0.0 + + class TimedLock(original_lock): + def __enter__(self) -> Any: + nonlocal lock_wait + started = time.perf_counter() + result = super().__enter__() + self._acquired = time.perf_counter() + lock_wait += self._acquired - started + return result + + def __exit__(self, *args: Any) -> None: + nonlocal registry_held + try: + super().__exit__(*args) + finally: + if self.path == engine.lock_root / "registry.lock": + registry_held += time.perf_counter() - self._acquired + + def validate_current(*args: Any, **kwargs: Any) -> Any: + nonlocal current_validation + started = time.perf_counter() + try: + return original_current_validate(*args, **kwargs) + finally: + current_validation += time.perf_counter() - started def validate(*args: Any, **kwargs: Any) -> Any: nonlocal active, validation_wall, validation_cpu counts["registry_validations"] += 1 active = True start_wall, start_cpu = time.perf_counter(), time.process_time() + profile.enable() try: return original_validate(*args, **kwargs) finally: + profile.disable() validation_wall += time.perf_counter() - start_wall validation_cpu += time.process_time() - start_cpu active = False @@ -124,15 +169,37 @@ def scandir(path: Any) -> Any: engine._load_recorded_plan = load module.project_path = project module.os.scandir = scandir + module.FileLock = TimedLock + engine._validate_plan_set = validate_current wall, cpu = time.perf_counter(), time.process_time() try: tokens = engine.reconcile_set((), current) reconcile_wall = time.perf_counter() - wall reconcile_cpu = time.process_time() - cpu finally: + engine._validate_registry = original_validate + engine._load_recorded_plan = original_load + engine._validate_plan_set = original_current_validate + module.FileLock = original_lock module.project_path = original_project module.os.scandir = original_scandir assert len(tokens) == plans and all(tokens) + filesystem_calls = {} + for (_, _, name), (_, calls, _, _, _) in pstats.Stats(profile).stats.items(): + for operation in ( + "nt.stat", + "nt.lstat", + "nt._getfinalpathname", + "nt._path_lexists", + "posix.stat", + "posix.lstat", + ): + if name == f"": + filesystem_calls[operation] = calls + if name == "_windows_file_attributes": + # ctypes native calls are opaque to cProfile. Count their fresh + # probe helper too; replacing lstat does not eliminate FS queries. + filesystem_calls["windows_attribute_probes"] = calls return { "retained_claims": claims, "current_plans": plans, @@ -142,7 +209,11 @@ def scandir(path: Any) -> Any: "validation_cpu_seconds": validation_cpu, "reconcile_wall_seconds": reconcile_wall, "reconcile_cpu_seconds": reconcile_cpu, + "lock_wait_wall_seconds": lock_wait, + "registry_lock_held_wall_seconds": registry_held, + "current_plan_validation_wall_seconds": current_validation, **counts, + "validation_filesystem_calls": filesystem_calls, "completed_plans": len(tokens), } @@ -157,13 +228,19 @@ def main() -> None: parser.add_argument("--plans", type=int, nargs="+", default=[1, 4]) parser.add_argument("--repeat", type=int, default=3) parser.add_argument("--work", type=Path) + parser.add_argument( + "--large", action="store_true", + help="opt into 129..4096 retained claims (setup and validation may take minutes)", + ) args = parser.parse_args() if ( - any(not 0 <= value <= 500 for value in args.claims) - or any(not 1 <= value <= 16 for value in args.plans) + any(not 0 <= value <= 4096 for value in args.claims) + or any(not 1 <= value <= 32 for value in args.plans) or not 1 <= args.repeat <= 20 ): - parser.error("expected 0..500 claims, 1..16 plans, and 1..20 repetitions") + parser.error("expected 0..4096 claims, 1..32 plans, and 1..20 repetitions") + if max(args.claims) > 128 and not args.large: + parser.error("more than 128 claims requires explicit --large opt-in") sources = {"candidate": args.source.resolve()} if args.baseline_source: sources = {"baseline": args.baseline_source.resolve(), **sources} @@ -177,8 +254,10 @@ def main() -> None: work = Path(tempfile.mkdtemp(prefix="protocyte-registry-benchmark-")) modules = {label: _load(source, label) for label, source in sources.items()} result: dict[str, Any] = { - "platform": platform.platform(), + "platform": platform.system(), "python": platform.python_version(), + "timings_include_instrumentation": True, + "setup_method": "private locked initialization/reconciliation (issue #54 POC)", "coordinator_sha256": { label: hashlib.sha256(Path(module.__file__).read_bytes()).hexdigest() for label, module in modules.items() diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..33f00e8 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,26 @@ +"""Keep integration fixtures out of the user's shared ownership registry.""" + +from __future__ import annotations + +import os +from pathlib import Path + +import pytest + + +@pytest.fixture(autouse=True) +def isolated_cmake_registry_cache( + request: pytest.FixtureRequest, +) -> None: + if request.node.get_closest_marker("cmake_integration") is None: + return + # Ownership fixtures already supply explicit lock roots. Older configure + # fixtures exercise the default selector; give that selector a private base + # too. All subprocesses/build trees in one test still share one namespace. + tmp_path: Path = request.getfixturevalue("tmp_path") + monkeypatch: pytest.MonkeyPatch = request.getfixturevalue("monkeypatch") + cache = tmp_path / "isolated-user-cache" + cache.mkdir() + monkeypatch.setenv( + "LOCALAPPDATA" if os.name == "nt" else "XDG_CACHE_HOME", str(cache) + ) diff --git a/tests/profile_output_registry.py b/tests/profile_output_registry.py new file mode 100644 index 0000000..f129cab --- /dev/null +++ b/tests/profile_output_registry.py @@ -0,0 +1,132 @@ +"""Offline, disjoint registry phase timings using fresh synthetic fixtures. + +Python 3.12+, stdlib only. This reuses benchmark_output_registry's real locked +fixture seeding and unchanged measured reconcile_set operation. Timers delegate +every check; nested calls belong only to their outermost measured phase. +Publish results.json only, never synthetic claim records or fixture directories. +""" + +from __future__ import annotations + +import argparse +import hashlib +import json +import platform +import tempfile +import time +from pathlib import Path +from types import ModuleType +from typing import Any + +from benchmark_output_registry import _load, _sample + + +def profile(module: ModuleType, work: Path, claims: int, plans: int) -> dict[str, Any]: + phase: str | None = None + partition: dict[str, dict[str, float | int]] = {} + + def measured(name: str, original: Any, *args: Any, **kwargs: Any) -> Any: + nonlocal phase + if phase != "registry": + return original(*args, **kwargs) + started = time.perf_counter() + phase = name + try: + return original(*args, **kwargs) + finally: + row = partition.setdefault(name, {"calls": 0, "wall_seconds": 0.0}) + row["calls"] += 1 + row["wall_seconds"] += time.perf_counter() - started + phase = "registry" + + original_engine = module.OutputCoordinator + original_claim_paths = original_engine._claim_paths + originals = { + name: getattr(module, name) + for name in ("_load_json", "_paths_overlap", "_path_key", "project_path") + } + + class InstrumentedEngine(original_engine): + def _validate_registry(self, *args: Any, **kwargs: Any) -> Any: + nonlocal phase + previous, phase = phase, "registry" + try: + return super()._validate_registry(*args, **kwargs) + finally: + phase = previous + + def _load_recorded_plan(self, *args: Any, **kwargs: Any) -> Any: + return measured( + "recorded_plan_authentication", + super()._load_recorded_plan, + *args, + **kwargs, + ) + + def claim_paths(*args: Any, **kwargs: Any) -> Any: + return measured( + "claim_path_authentication", original_claim_paths, *args, **kwargs + ) + + original_engine._claim_paths = staticmethod(claim_paths) + module.OutputCoordinator = InstrumentedEngine + for name, original in originals.items(): + + def wrapper( + *args: Any, _name: str = name, _original: Any = original, **kwargs: Any + ) -> Any: + return measured(_name, _original, *args, **kwargs) + + setattr(module, name, wrapper) + try: + sample = _sample(module, work / "sample", claims, plans) + finally: + original_engine._claim_paths = staticmethod(original_claim_paths) + module.OutputCoordinator = original_engine + for name, original in originals.items(): + setattr(module, name, original) + # These counters confirm that the post-#52 measured scan still authenticates + # every retained claim/plan. Instrumentation never skips foreign records. + for name in ( + "recorded_plan_authentication", + "claim_path_authentication", + "_load_json", + ): + assert partition.get(name, {}).get("calls", 0) == claims + return {"sample": sample, "disjoint_direct_registry_phases": partition} + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--claims", type=int, default=64) + parser.add_argument("--plans", type=int, default=11) + parser.add_argument("--work", type=Path) + args = parser.parse_args() + if not 0 <= args.claims <= 128 or not 1 <= args.plans <= 32: + parser.error( + "expected 0..128 claims and 1..32 plans; use the scaling benchmark for larger runs" + ) + if args.work: + work = args.work.absolute() + work.mkdir(parents=True, exist_ok=False) + else: + work = Path(tempfile.mkdtemp(prefix="protocyte-registry-phases-")) + module = _load(Path(__file__).resolve().parents[1], "phases") + result = { + "platform": platform.system(), + "python": platform.python_version(), + "coordinator_sha256": hashlib.sha256( + Path(module.__file__).read_bytes() + ).hexdigest(), + "timings_include_instrumentation": True, + "measurement": "Disjoint outermost function timers; every check delegates unchanged", + **profile(module, work, args.claims, args.plans), + } + (work / "results.json").write_text( + json.dumps(result, indent=2) + "\n", encoding="utf-8" + ) + print(json.dumps(result), flush=True) + + +if __name__ == "__main__": + main() diff --git a/tests/registry_validation_poc.py b/tests/registry_validation_poc.py new file mode 100644 index 0000000..e2d0694 --- /dev/null +++ b/tests/registry_validation_poc.py @@ -0,0 +1,261 @@ +"""Standalone output-registry scaling/progress POC; Python 3.12+, stdlib only. + +Run from a Protocyte checkout. All state lives in a NEW synthetic workspace; +the default/shared registry and source checkout are never modified. +Fixtures are retained locally. Publish only this script and results.json, +not the synthetic claim files (which necessarily contain local paths). + +From issue #54. The measured sample method is unchanged. Progress metadata +supports a reporter without a lifetime cap; the encoding lambda is spelled as +a function for repository lint. The original issue remains the baseline source. +Counters also include optional Windows attribute probes and native existence +queries so cheaper metadata cannot masquerade as eliminating FS observations. +""" + +from __future__ import annotations + +import argparse +import contextlib +import cProfile +import hashlib +import importlib.util +import io +import json +import os +import platform +import pstats +import re +import sys +import tempfile +import time +from pathlib import Path + + +def load(path): + spec = importlib.util.spec_from_file_location("coordinator_poc", path) + module = importlib.util.module_from_spec(spec) + sys.modules[spec.name] = module + spec.loader.exec_module(module) + return module + + +def plan(module, work, name): + directory = work / name + build = directory / "build" + build.mkdir(parents=True) + root = directory / "generated" + target = hashlib.sha256(name.encode()).hexdigest() + staging = directory / (".protocyte-generation-staging-" + target) + + def encoded(value): + return os.fspath(value).encode("utf-8").hex() + + path = directory / "outputs.plan" + path.write_text( + "\n".join( + [ + module.PLAN_HEADER, + "root-hex=" + encoded(root), + "build-root-hex=" + encoded(build), + "target=" + target + "|" + encoded(staging), + "output=" + target + "|" + encoded("sample.protocyte.hpp"), + ] + ) + + "\n", + encoding="ascii", + ) + return module.Plan.read(path) + + +def sample(module, work, retained_count, current_count): + setup_start = time.perf_counter() + retained = [plan(module, work, "retained-%04d" % i) for i in range(retained_count)] + current = [plan(module, work, "current-%04d" % i) for i in range(current_count)] + engine = module.OutputCoordinator(work / "isolated-registry") + + # Fixture seeding only: avoid quadratic conflict comparisons during setup. + # Use real initialization/reconciliation helpers under PRIVATE locks. + # No method is replaced during seeding; all roots/targets are disjoint. + module._durable_mkdir(engine.lock_root) + with module.FileLock(engine.lock_root / "registry.lock"): + for item in retained: + with ( + module.FileLock(engine._generation_lock(item.root)), + module.FileLock(engine._publication_lock(item.root)), + ): + state = engine._state_directory(item.root) + engine._initialize_claim_locked(state, item) + engine._reconcile_locked(state, item) + setup_seconds = time.perf_counter() - setup_start + + active = False + counts = {} + originals = {} + profile = cProfile.Profile() + validation_wall = validation_cpu = 0.0 + original_validate = engine._validate_registry + + def validate(*args, **kwargs): + nonlocal active, validation_wall, validation_cpu + counts["registry_validations"] = counts.get("registry_validations", 0) + 1 + active = True + wall, cpu = time.perf_counter(), time.process_time() + profile.enable() + try: + return original_validate(*args, **kwargs) + finally: + profile.disable() + validation_wall += time.perf_counter() - wall + validation_cpu += time.process_time() - cpu + active = False + + names = ( + "project_path", + "_paths_overlap", + "_path_key", + "_physical_location_key", + "_same_physical_path", + "_windows_file_attributes", + ) + for name in names: + if not hasattr(module, name): + continue + original = getattr(module, name) + originals[name] = original + + def counted(*args, _name=name, _original=original, **kwargs): + if active: + counts[_name] = counts.get(_name, 0) + 1 + return _original(*args, **kwargs) + + setattr(module, name, counted) + engine._validate_registry = validate + wall, cpu = time.perf_counter(), time.process_time() + try: + # This is the measured production operation, with every check, + # filesystem call, and lock delegated unchanged. + tokens = engine.reconcile_set((), current) + finally: + reconcile_wall = time.perf_counter() - wall + reconcile_cpu = time.process_time() - cpu + engine._validate_registry = original_validate + for name, original in originals.items(): + setattr(module, name, original) + assert len(tokens) == current_count and all(tokens) + + filesystem = {} + for (_, _, name), (_, calls, own, _, _) in pstats.Stats(profile).stats.items(): + for operation in ( + "nt.stat", + "nt.lstat", + "nt._getfinalpathname", + "nt._path_lexists", + ): + if name == "" % operation: + filesystem[operation] = { + "calls": calls, + "own_seconds": round(own, 6), + } + if name == "_windows_file_attributes": + filesystem["windows_attribute_probes"] = { + "calls": calls, + "own_seconds": round(own, 6), + } + return { + "retained_claims": retained_count, + "current_plans": current_count, + "setup_seconds": round(setup_seconds, 6), + "validation_wall_seconds": round(validation_wall, 6), + "validation_cpu_seconds": round(validation_cpu, 6), + "reconcile_wall_seconds": round(reconcile_wall, 6), + "reconcile_cpu_seconds": round(reconcile_cpu, 6), + "validation_operation_counts": counts, + "validation_filesystem_calls": filesystem, + "completed_plans": len(tokens), + } + + +def progress_demo(module): + """Demonstrate the cutoff quickly; only the reporting interval is scaled.""" + original_interval = module._ReconcileProgress.INTERVAL_SECONDS + max_reports = getattr(module._ReconcileProgress, "MAX_REPORTS", None) + stream = io.StringIO() + try: + module._ReconcileProgress.INTERVAL_SECONDS = 0.01 + with contextlib.redirect_stderr(stream): + with module._ReconcileProgress(1, 0) as progress: + progress.phase("validating registry", "validation") + progress.registry(states=100) + for _ in range(40): + progress.registry(claim=True) + time.sleep(0.01) + finally: + module._ReconcileProgress.INTERVAL_SECONDS = original_interval + lines = stream.getvalue().splitlines() + periodic = [line for line in lines if ": complete;" not in line] + last = periodic[-1] if periodic else "" + match = re.search(r"claims_checked=(\d+)", last) + return { + "production_interval_seconds": original_interval, + "production_max_periodic_reports": max_reports, + "nominal_production_cutoff_seconds": ( + original_interval * max_reports if max_reports is not None else None + ), + "demo_interval_seconds": 0.01, + "periodic_reports": len(periodic), + "claims_at_last_periodic_report": int(match[1]) if match else None, + "claims_at_completion": progress._claims, + "suppression_message_seen": "further progress suppressed" in last, + "completion_message_seen": any(": complete;" in line for line in lines), + } + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "--coordinator", + type=Path, + default=Path("cmake/ProtocyteOutputCoordinator.py"), + ) + parser.add_argument("--claims", type=int, nargs="+", default=[0, 8, 16]) + parser.add_argument("--plans", type=int, nargs="+", default=[1, 11]) + parser.add_argument("--repeat", type=int, default=1) + parser.add_argument("--work", type=Path) + args = parser.parse_args() + if ( + any(not 0 <= n <= 4096 for n in args.claims) + or any(not 1 <= n <= 32 for n in args.plans) + or not 1 <= args.repeat <= 10 + ): + parser.error("expected 0..4096 claims, 1..32 plans, 1..10 repetitions") + source = args.coordinator.resolve(strict=True) + module = load(source) + if args.work: + root = args.work.absolute() + root.mkdir(parents=True, exist_ok=False) + else: + root = Path(tempfile.mkdtemp(prefix="protocyte-registry-poc-")) + root = root.resolve(strict=True) + result = { + "os": platform.system(), + "python": platform.python_version(), + "coordinator_sha256": hashlib.sha256(source.read_bytes()).hexdigest(), + "timings_include_instrumentation": True, + "samples": [], + } + for repetition in range(args.repeat): + for claims in args.claims: + for plans in args.plans: + work = root / ("r%d-c%d-p%d" % (repetition, claims, plans)) + row = {"repetition": repetition, **sample(module, work, claims, plans)} + result["samples"].append(row) + print(json.dumps(row), flush=True) + result["progress_demo"] = progress_demo(module) + (root / "results.json").write_text( + json.dumps(result, indent=2) + "\n", encoding="utf-8" + ) + print(json.dumps(result["progress_demo"]), flush=True) + + +if __name__ == "__main__": + main() diff --git a/tests/test_output_coordinator.py b/tests/test_output_coordinator.py index 9fe66a5..68eb0b4 100644 --- a/tests/test_output_coordinator.py +++ b/tests/test_output_coordinator.py @@ -108,6 +108,45 @@ def resolve_after_deletion(path: Path, strict: bool = False) -> Path: assert interrupted +@pytest.mark.parametrize("replacement", ["absent", "file", "directory-link"]) +def test_projection_rechecks_a_leaf_replaced_before_chain_validation( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, replacement: str +) -> None: + leaf = tmp_path / "disappearing" + leaf.mkdir() + original_lexists = coordinator.os.path.lexists + original_is_link = coordinator._is_link + removed = False + inspected: list[Path] = [] + + def lexists(path: Path) -> bool: + nonlocal removed + result = original_lexists(path) + if path == leaf and not removed: + removed = True + leaf.rmdir() + if replacement == "file": + leaf.touch() + elif replacement == "directory-link": + _directory_link(leaf, tmp_path) + return result + + def is_link(path: Path) -> bool: + inspected.append(path) + return original_is_link(path) + + monkeypatch.setattr(coordinator.os.path, "lexists", lexists) + monkeypatch.setattr(coordinator, "_is_link", is_link) + if replacement == "absent": + assert coordinator.project_path(leaf) == leaf + else: + with pytest.raises( + coordinator.CoordinatorError, match="symbolic link or junction|non-directory" + ): + coordinator.project_path(leaf) + assert removed and leaf in inspected + + def test_durable_directory_creation_resyncs_a_preexisting_retry_chain( tmp_path: Path, monkeypatch: pytest.MonkeyPatch ) -> None: @@ -1680,19 +1719,41 @@ def test_physical_containment_checks_ancestors_of_missing_paths( first, alias = tmp_path / "first", tmp_path / "alias" first.mkdir() alias.mkdir() - original_samefile = coordinator.os.path.samefile + original_lstat = Path.lstat - def samefile(left: object, right: object) -> bool: - if {Path(left), Path(right)} == {first, alias}: - return True - return original_samefile(left, right) + def lstat(path: Path) -> os.stat_result: + # Model the actual samefile identity relation, including ancestor IDs. + return original_lstat(first if path == alias else path) - monkeypatch.setattr(coordinator.os.path, "samefile", samefile) + monkeypatch.setattr(Path, "lstat", lstat) assert coordinator._paths_overlap(first, alias / "missing" / "nested") assert coordinator._paths_overlap(alias / "missing" / "nested", first) assert not coordinator._paths_overlap(first, tmp_path / "unrelated") +@pytest.mark.skipif(os.name != "nt", reason="requires Windows short directory names") +def test_overlap_preserves_windows_short_name_aliases(tmp_path: Path) -> None: + import ctypes + + directory = tmp_path / "directory-with-a-long-name" + directory.mkdir() + get_short_path = ctypes.WinDLL("kernel32", use_last_error=True).GetShortPathNameW + get_short_path.argtypes = (ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_uint32) + get_short_path.restype = ctypes.c_uint32 + buffer = ctypes.create_unicode_buffer(32768) + length = get_short_path(str(directory), buffer, len(buffer)) + if ( + not length + or length >= len(buffer) + or buffer.value.casefold() == str(directory).casefold() + ): + pytest.skip("filesystem does not provide a distinct 8.3 directory spelling") + alias = Path(buffer.value) + assert coordinator._path_key(directory) == coordinator._path_key(alias) + assert coordinator._paths_overlap(directory / "missing", alias / "missing/child") + assert coordinator._paths_overlap(alias / "missing/child", directory / "missing") + + @pytest.mark.parametrize("replacement", ["file", "directory-link"]) @pytest.mark.parametrize("side", [0, 1]) def test_overlap_rejects_path_replacement_during_the_comparison( @@ -1745,6 +1806,85 @@ def lstat_with_alias(path: Path) -> os.stat_result: assert not coordinator._paths_overlap(first / "missing", alias / "other") +@pytest.mark.parametrize("depth", [1, 16, 64]) +def test_physical_ancestry_observations_are_linear_in_missing_depth( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, depth: int +) -> None: + child = tmp_path.joinpath(*(f"missing-{index}" for index in range(depth))) + observed: list[Path] = [] + original_lstat = Path.lstat + + def lstat(path: Path) -> os.stat_result: + observed.append(path) + return original_lstat(path) + + monkeypatch.setattr(Path, "lstat", lstat) + keys = list(coordinator._physical_ancestor_keys(child)) + assert len(observed) == len(child.parents) + 1 + assert len(set(observed)) == len(observed) + assert len(keys) == len(observed) + anchor = original_lstat(tmp_path) + assert keys[0] == ( + anchor.st_dev, + anchor.st_ino, + tuple(f"missing-{index}" for index in range(depth)), + ) + + +@pytest.mark.parametrize("depth", [1, 64]) +def test_overlap_metadata_probes_stay_linear_in_missing_depth( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, depth: int +) -> None: + first = tmp_path / "first" + second = tmp_path / "second" + first.mkdir() + second.mkdir() + for index in range(depth): + first /= f"missing-{index}" + second /= f"missing-{index}" + original_lstat = Path.lstat + observations = 0 + + def lstat(path: Path) -> os.stat_result: + nonlocal observations + observations += 1 + return original_lstat(path) + + monkeypatch.setattr(Path, "lstat", lstat) + assert not coordinator._paths_overlap(first, second) + # Includes fresh projections, both directional physical checks and platform + # pathlib behavior. A generous linear bound still catches repeated searches + # of the missing suffix for each ancestor (the former quadratic behavior). + assert observations <= 12 * (len(first.parents) + len(second.parents)) + + +@pytest.mark.parametrize("replacement", ["file", "directory-link"]) +def test_physical_ancestry_rejects_ancestor_replacement_after_projection( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, replacement: str +) -> None: + parent = tmp_path / "parent" + ancestor = tmp_path / "ancestor" + ancestor.mkdir() + child = ancestor / "missing" + original_project = coordinator.project_path + + def project(path: Path, **options: object) -> Path: + result = original_project(path, **options) + if path == child: + ancestor.rmdir() + if replacement == "file": + ancestor.touch() + else: + _directory_link(ancestor, tmp_path) + return result + + monkeypatch.setattr(coordinator, "project_path", project) + with pytest.raises( + coordinator.CoordinatorError, match="symbolic link or junction|non-directory" + ): + coordinator._paths_overlap(parent, child) + + def _directory_link(link: Path, destination: Path) -> None: try: link.symlink_to(destination, target_is_directory=True) @@ -1824,10 +1964,9 @@ def validate(*args: object, **kwargs: object) -> None: assert not list((engine.lock_root / "roots").glob("*/claim.json")) -def test_progress_is_bounded_path_free_and_keeps_stdout_clean( - capsys: pytest.CaptureFixture[str], monkeypatch: pytest.MonkeyPatch +def test_progress_continues_past_former_cutoff_and_keeps_stdout_clean( + capsys: pytest.CaptureFixture[str], ) -> None: - monkeypatch.setattr(coordinator._ReconcileProgress, "MAX_REPORTS", 3) with coordinator._ReconcileProgress(4, 1) as progress: progress.phase("waiting for registry lock", "lock_wait") assert progress._report() @@ -1836,17 +1975,19 @@ def test_progress_is_bounded_path_free_and_keeps_stdout_clean( assert progress._report() progress.phase("reconciling outputs", "reconciliation") assert progress._report() - for _ in range(10): - assert not progress._report() + for _ in range(20): + progress.registry(claim=True) + assert progress._report() output = capsys.readouterr() assert not output.out - assert len(output.err.splitlines()) == 4 + assert len(output.err.splitlines()) == 24 assert "waiting for registry lock" in output.err assert "validating registry" in output.err assert "current_plans=4 retired_plans=1" in output.err assert "claims_checked=1 registry_entries=8" in output.err assert "lock_wait=" in output.err and "validation=" in output.err - assert "further progress suppressed" in output.err + assert "claims_checked=21 registry_entries=8" in output.err + assert "further progress suppressed" not in output.err assert "complete;" in output.err @@ -1866,6 +2007,27 @@ def test_progress_reports_failure_and_fast_operations_stay_silent( assert "failed;" in output.err +def test_progress_worker_keeps_reporting_until_stopped( + capsys: pytest.CaptureFixture[str], monkeypatch: pytest.MonkeyPatch +) -> None: + progress = coordinator._ReconcileProgress(11, 0) + progress.phase("validating registry", "validation") + progress.registry(states=24) + + class ControlledStop: + def wait(self, interval: float) -> bool: + assert interval == progress.INTERVAL_SECONDS + progress.registry(claim=True) + return progress._claims == 24 + + monkeypatch.setattr(progress, "_stop", ControlledStop()) + progress._run() + output = capsys.readouterr() + assert not output.out + assert len(output.err.splitlines()) == 23 + assert "claims_checked=23 registry_entries=24" in output.err + + @pytest.mark.skipif(os.name == "nt", reason="requires case-sensitive paths") def test_case_distinct_build_roots_cannot_share_a_claim(tmp_path: Path) -> None: root = tmp_path / "generated" @@ -1945,8 +2107,14 @@ def test_physical_output_root_aliases_cannot_receive_distinct_claims( ((_target("second"), "second.protocyte.hpp"),), ) original_samefile = coordinator.os.path.samefile + original_lstat = Path.lstat aliases = {os.path.normcase(os.fspath(root_a)), os.path.normcase(os.fspath(root_b))} + def lstat_with_root_alias(path: Path) -> os.stat_result: + # Non-link physical aliases have matching directory IDs, not just a + # samefile override. Exercise the non-following containment checks too. + return original_lstat(root_a if path == root_b else path) + def samefile_with_root_alias(first_path: object, second_path: object) -> bool: pair = { os.path.normcase(os.fspath(first_path)), @@ -1957,6 +2125,7 @@ def samefile_with_root_alias(first_path: object, second_path: object) -> bool: return original_samefile(first_path, second_path) monkeypatch.setattr(coordinator.os.path, "samefile", samefile_with_root_alias) + monkeypatch.setattr(Path, "lstat", lstat_with_root_alias) engine = coordinator.OutputCoordinator(lock_root) with pytest.raises(coordinator.CoordinatorError, match="overlapping roots"): diff --git a/tests/test_output_coordinator_cmake.py b/tests/test_output_coordinator_cmake.py index c6447e6..98f75a2 100644 --- a/tests/test_output_coordinator_cmake.py +++ b/tests/test_output_coordinator_cmake.py @@ -30,6 +30,35 @@ def _configure(source: Path, build: Path) -> subprocess.CompletedProcess[str]: return _configure_out_dir_owner_project(source, build, "-G", "Ninja") +def test_default_registry_selector_uses_the_isolated_test_cache(tmp_path: Path) -> None: + source = tmp_path / "project" + source.mkdir() + repo_root = Path(__file__).resolve().parents[1] + result_path = tmp_path / "selected.txt" + (source / "CMakeLists.txt").write_text( + "\n".join( + [ + "cmake_minimum_required(VERSION 3.24)", + "project(registry_isolation LANGUAGES NONE)", + f'include("{(repo_root / "cmake/ProtocyteFunctions.cmake").as_posix()}")', + "_protocyte_shared_output_lock_directory(selected)", + f'file(WRITE "{result_path.as_posix()}" "${{selected}}")', + ] + ) + "\n", + encoding="utf-8", + ) + result = subprocess.run( + ["cmake", "-S", str(source), "-B", str(tmp_path / "build")], + capture_output=True, + text=True, + check=False, + ) + assert result.returncode == 0, result.stdout + result.stderr + assert Path(result_path.read_text()).resolve() == ( + tmp_path / "isolated-user-cache/protocyte/output-locks-v1" + ).resolve() + + def test_coordinator_recovers_default_output_after_build_tree_recreation( tmp_path: Path, ) -> None: From b7a2d67ed0f26733f22c516e88d60f33ffc5c3a8 Mon Sep 17 00:00:00 2001 From: Anthony Printup <92564080+anthonyprintup@users.noreply.github.com> Date: Mon, 16 Nov 2026 03:19:45 +0100 Subject: [PATCH 03/12] perf(coordinator): prototype ownership index with reference authority Add a filesystem-independent lexical and physical reservation index and a scoped sampled-authentication preview. Keep reference validation as the default and the sole authority in optional shadow mode; every reference rejection is preserved and preview disagreement fails closed before normal reconciliation. Do not provide index-only authorization or change record formats and lock order. Install the optional helper beside the coordinator without prefix bytecode writes. Cover relocation, ownership exemptions, sampled-path races, parser failures, sample expiry, read-only behavior and the existing token protocol. Extend isolated benchmarks with explicit shadow phases, alternate layouts, source-bundle fingerprints and drift rejection. Record the exact 2172-claim, 11-plan read-only phase at 28.480 seconds plus 1.184 seconds current-plan validation, clearly excluding authority, setup and the required reference pass. Document the unresolved filesystem lifetime proof and defer production promotion. Validation: full default Python regression suite; CMake integration 17 passed, 1 skipped; shadow coordinator 87 passed, 6 skipped; Python 3.12 coordinator/index 113 passed, 6 skipped; final multi-target full shadow benchmark agreement; Ruff and whitespace checks. No C++ sources or generated smoke outputs changed. --- CMakeLists.txt | 1 + cmake/ProtocyteOutputCoordinator.py | 327 +++++++++++++++++-- cmake/ProtocyteOwnershipIndex.py | 122 +++++++ docs/experimental-index-contract.md | 70 ++++ docs/experimental-index-results.json | 259 +++++++++++++++ docs/experimental-index-results.md | 108 +++++++ docs/generation-engine-proposal.md | 7 +- docs/registry-validation-30s-plan.md | 5 +- docs/wiki/Contributing.md | 29 ++ tests/benchmark_output_registry.py | 211 +++++++++--- tests/benchmark_ownership_preview.py | 128 ++++++++ tests/registry_validation_poc.py | 36 ++- tests/test_output_coordinator.py | 14 +- tests/test_output_coordinator_cmake.py | 115 +++++-- tests/test_ownership_index.py | 429 +++++++++++++++++++++++++ 15 files changed, 1767 insertions(+), 94 deletions(-) create mode 100644 cmake/ProtocyteOwnershipIndex.py create mode 100644 docs/experimental-index-contract.md create mode 100644 docs/experimental-index-results.json create mode 100644 docs/experimental-index-results.md create mode 100644 tests/benchmark_ownership_preview.py create mode 100644 tests/test_ownership_index.py diff --git a/CMakeLists.txt b/CMakeLists.txt index a5f66b5..2071b9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,6 +174,7 @@ if(PROTOCYTE_INSTALL) "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteSourceDependency.cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteGenerate.cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteOutputCoordinator.py" + "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteOwnershipIndex.py" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteResetOutputDirectory.cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteFunctions.cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteProcess.cmake" diff --git a/cmake/ProtocyteOutputCoordinator.py b/cmake/ProtocyteOutputCoordinator.py index 9b500f2..1e64e0f 100644 --- a/cmake/ProtocyteOutputCoordinator.py +++ b/cmake/ProtocyteOutputCoordinator.py @@ -20,6 +20,7 @@ import contextlib import ctypes import hashlib +import importlib.util import json import os import secrets @@ -744,7 +745,9 @@ def read(cls, path: Path) -> Plan: ) @classmethod - def from_payload(cls, payload: Mapping[str, Any], source: Path) -> Plan: + def from_payload( + cls, payload: Mapping[str, Any], source: Path, *, _filesystem: Any = None + ) -> Plan: if ( set(payload) != { @@ -761,8 +764,10 @@ def from_payload(cls, payload: Mapping[str, Any], source: Path) -> Plan: or not isinstance(payload["targets"], list) ): _fail(f"configured output plan is malformed: {source}") - root = project_path(Path(str(payload["root"]))) - build_root = project_path(Path(str(payload["build_root"]))) + project = project_path if _filesystem is None else _filesystem.project + path_key = _path_key if _filesystem is None else _filesystem.path_key + root = project(Path(str(payload["root"]))) + build_root = project(Path(str(payload["build_root"]))) outputs: list[PlanOutput] = [] for value in payload["outputs"]: if ( @@ -789,7 +794,7 @@ def from_payload(cls, payload: Mapping[str, Any], source: Path) -> Plan: PlanTarget( identity, _validate_staging_path( - root, identity, Path(str(value["staging"])) + root, identity, Path(str(value["staging"])), _filesystem=_filesystem ), ) ) @@ -797,7 +802,7 @@ def from_payload(cls, payload: Mapping[str, Any], source: Path) -> Plan: plan = cls( root, build_root, - _path_key(build_root), + path_key(build_root), tuple(sorted(targets, key=lambda target: target.identity)), tuple(sorted(outputs, key=lambda output: (output.relative, output.target))), ) @@ -813,11 +818,13 @@ def staging_for_target(self, identity: str) -> Path: def _validate_staging_path( - root: Path | None, identity: str, path: Path + root: Path | None, identity: str, path: Path, *, _filesystem: Any = None ) -> Path: - path = project_path(_require_absolute(path, "generation staging directory")) + project = project_path if _filesystem is None else _filesystem.project + overlaps = _paths_overlap if _filesystem is None else _filesystem.overlaps + path = project(_require_absolute(path, "generation staging directory")) if root is not None: - expected = project_path( + expected = project( root.parent / f".protocyte-generation-staging-{identity}" ) if path != expected: @@ -825,7 +832,7 @@ def _validate_staging_path( "output plan target metadata contains an unexpected staging directory: " f"{path}" ) - if _paths_overlap(root, path): + if overlaps(root, path): _fail( "output plan generation staging overlaps its own output root: " f"{path} and {root}" @@ -878,9 +885,109 @@ def _generation_environment() -> dict[str, str]: return environment +_ownership_module: Any = None + + +def _load_ownership_index() -> Any: + global _ownership_module + if _ownership_module is None: + path = Path(__file__).with_name("ProtocyteOwnershipIndex.py") + name = f"{__name__}_ownership_index" + spec = importlib.util.spec_from_file_location(name, path) + if spec is None or spec.loader is None: + _fail("experimental ownership index could not be loaded") + module = importlib.util.module_from_spec(spec) + sys.modules[name] = module + try: + # Loading an optional preview must not create __pycache__ in a + # source/installed prefix. Compile exactly the trusted sibling + # source; do not change process-global bytecode/import settings. + exec(compile(path.read_bytes(), os.fspath(path), "exec"), module.__dict__) + except BaseException: + sys.modules.pop(name, None) + raise + _ownership_module = module + return _ownership_module + + +class _SampledRegistryFilesystem: + """Read-only, non-authoritative samples for one experimental preview. + + Only the shadow preview may use these cached observations. They do not + survive its scope or replace any fresh reference/mutation-time checks. + """ + + def __init__(self, model: Any) -> None: + self._model = model + self._projected: dict[str, Path] = {} + self._facts: dict[str, Any] = {} + self._closed = False + self.projections = 0 + self.observations = 0 + + def close(self) -> None: + self._closed = True + self._projected.clear() + self._facts.clear() + + def project(self, path: Path) -> Path: + if self._closed: + _fail("experimental filesystem sample used outside its preview") + name = os.fspath(_require_absolute(path, "sampled directory")) + if name not in self._projected: + projected = project_path(path) + self.projections += 1 + self._projected[name] = projected + self._projected.setdefault(os.fspath(projected), projected) + return self._projected[name] + + def path_key(self, path: Path) -> str: + identity = os.fspath(self.project(path)).replace("\\", "/").casefold() + return _sha256_bytes(identity.encode("utf-8")) + + def facts(self, path: Path) -> Any: + projected = self.project(path) + name = os.fspath(projected) + if name not in self._facts: + ancestors = tuple(_physical_ancestor_keys(projected)) + location = _physical_location_key(projected) + if location not in ancestors: + _fail("experimental sample observed a changed physical identity") + self._facts[name] = self._model.DirectoryObservation( + name.replace("\\", "/").casefold().rstrip("/"), + location, + ancestors, + ) + self.observations += 1 + return self._facts[name] + + def overlaps(self, first: Path, second: Path) -> bool: + return bool(self.facts(first).overlaps(self.facts(second))) + + def contains(self, parent: Path, child: Path) -> bool: + return _projected_contains(self.project(parent), self.project(child)) + + def physically_contains(self, parent: Path, child: Path) -> bool: + return self.facts(parent).location in self.facts(child).ancestors + + def same_path(self, first: Path, second: Path) -> bool: + if self._closed: + _fail("experimental filesystem sample used outside its preview") + if first == second: + return True + first_key, second_key = self.facts(first).location, self.facts(second).location + # samefile fails for missing endpoints. Do not turn equivalent missing + # suffixes into a successful immutable claim/plan identity binding. + return not first_key[2] and not second_key[2] and first_key == second_key + + class OutputCoordinator: - def __init__(self, lock_root: Path) -> None: + def __init__(self, lock_root: Path, *, registry_validation: str = "reference") -> None: + if registry_validation not in ("reference", "shadow"): + _fail("registry validation must be reference or shadow") self.lock_root = project_path(_require_absolute(lock_root, "output lock root")) + self.registry_validation = registry_validation + self.validation_metrics: dict[str, Any] = {} def reconcile(self, plan: Plan) -> str: # All claim/plan writers hold the registry lock through plan commit, so @@ -1290,6 +1397,164 @@ def _validate_registry( retiring_root_keys: set[str] | None = None, *, progress: _ReconcileProgress | None = None, + ) -> None: + metrics: dict[str, Any] = { + "mode": self.registry_validation, + "authoritative": "reference", + "preview_wall_seconds": 0.0, + "reference_wall_seconds": 0.0, + "agreement": None, + } + self.validation_metrics = metrics + preview_accepted: bool | None = None + if self.registry_validation == "shadow": + if progress is not None: + progress.phase("sampling experimental ownership index", "validation") + started = time.perf_counter() + try: + preview_accepted = self._preview_registry_index( + plans, retiring_root_keys or set(), progress=progress + ) + metrics["preview_result"] = "accepted" if preview_accepted else "conflict" + except Exception as error: + # Even a preview/parser failure cannot replace a fresh reference + # pass. Keep diagnostics path-free and fail closed if reference + # later accepts; preserve its original error if it rejects. + metrics["preview_result"] = "sample-error" + metrics["preview_error_type"] = type(error).__name__ + finally: + metrics["preview_wall_seconds"] = time.perf_counter() - started + self._inject("after-index-preview") + if progress is not None: + progress.phase("validating registry (reference authority)", "validation") + + started = time.perf_counter() + try: + self._validate_registry_reference(plans, retiring_root_keys, progress=progress) + except CoordinatorError: + metrics["reference_result"] = "rejected" + if preview_accepted is not None: + metrics["agreement"] = not preview_accepted + raise + finally: + metrics["reference_wall_seconds"] = time.perf_counter() - started + metrics["reference_result"] = "accepted" + if self.registry_validation == "shadow": + metrics["agreement"] = preview_accepted is True + if preview_accepted is not True: + _fail( + "experimental ownership index disagrees with the fresh reference " + "validator; no reconciliation changes were authorized" + ) + + def _preview_registry_index( + self, + plans: Sequence[Plan], + retiring_root_keys: set[str], + *, + progress: _ReconcileProgress | None = None, + ) -> bool: + """Sample all ownership records without authorizing or mutating anything. + + The caller holds the ordinary reconciliation locks. Filesystem facts are + deliberately untrusted across comparisons: only the subsequent fresh + reference pass can authorize proceeding. No preview objects escape. + """ + model = _load_ownership_index() + sample = _SampledRegistryFilesystem(model) + metrics = self.validation_metrics + metrics.update(preview_claims=0, preview_records_read=0, preview_unclaimed_states=0) + reservations: list[Any] = [] + try: + internal_paths = ( + self.lock_root / "roots", self.lock_root / "generation", + self.lock_root / "publication", + ) + for plan in plans: + for target in plan.targets: + if sample.contains(target.staging, self.lock_root) or sample.physically_contains( + target.staging, self.lock_root + ): + metrics["preview_conflict"] = "staging-lock-namespace" + return False + if sample.overlaps(plan.root, self.lock_root) or any( + sample.overlaps(path, plan.root) for path in internal_paths + ): + metrics["preview_conflict"] = "root-lock-namespace" + return False + roots = self.lock_root / "roots" + if plans and os.path.lexists(roots): + if sample.project(roots) != roots: + _fail("experimental sample found an unsafe registry path") + with os.scandir(roots) as stream: + states = sorted(stream, key=lambda entry: entry.name) + for entry in states: + state = roots / entry.name + if ( + _is_link(state) or not entry.is_dir(follow_symlinks=False) + or not _is_sha256(entry.name) + ): + _fail("experimental sample found an unsafe registry entry") + with os.scandir(state) as stream: + names = {child.name for child in stream} + if "claim.json" not in names: + # Reference validation owns abandoned-initialization + # cleanup. A preview must never mutate registry state. + metrics["preview_unclaimed_states"] += 1 + continue + source = state / "claim.json" + claim = _load_json(source, "output claim") + metrics["preview_records_read"] += 1 + self._validate_claim_shape(claim, source) + root, _ = self._claim_paths(claim, source, _filesystem=sample) + if entry.name != claim["root_key"]: + _fail("experimental sample found a claim under the wrong key") + recorded = self._load_recorded_plan(state, claim, _filesystem=sample) + if recorded is not None: + metrics["preview_records_read"] += 1 + root_key, build_id = str(claim["root_key"]), str(claim["build_id"]) + reservations.append(model.Reservation( + "root", root_key, build_id, None, sample.facts(root) + )) + if recorded is not None: + reservations.extend( + model.Reservation( + "staging", root_key, build_id, target.identity, + sample.facts(target.staging), + ) + for target in recorded.targets + ) + metrics["preview_claims"] += 1 + if progress is not None: + progress.phase( + f"sampling experimental index ({metrics['preview_claims']} claims)", + "validation", + ) + index = model.OwnershipIndex(reservations) + metrics["indexed_reservations"] = len(reservations) + for plan in plans: + conflict = index.conflict( + root=sample.facts(plan.root), root_key=sample.path_key(plan.root), + build_id=plan.build_id, + staging=((target.identity, sample.facts(target.staging)) for target in plan.targets), + retiring_root_keys=retiring_root_keys, + ) + metrics["index_queries"] = index.queries + if conflict is not None: + metrics["preview_conflict"] = conflict + return False + return True + finally: + metrics["sampled_geometry_projections"] = sample.projections + metrics["sampled_directory_observations"] = sample.observations + sample.close() + + def _validate_registry_reference( + self, + plans: Sequence[Plan], + retiring_root_keys: set[str] | None = None, + *, + progress: _ReconcileProgress | None = None, ) -> None: if not plans: return @@ -1426,26 +1691,32 @@ def _load_claim(self, state: Path, plan: Plan) -> dict[str, Any]: @staticmethod def _require_plan_claim_binding( - plan: Plan, claim: Mapping[str, Any], source: Path + plan: Plan, claim: Mapping[str, Any], source: Path, *, _filesystem: Any = None ) -> None: - claim_root, claim_build_root = OutputCoordinator._claim_paths(claim, source) + path_key = _path_key if _filesystem is None else _filesystem.path_key + same_path = _same_physical_path if _filesystem is None else _filesystem.same_path + claim_root, claim_build_root = OutputCoordinator._claim_paths( + claim, source, _filesystem=_filesystem + ) if ( - str(claim["root_key"]) != _path_key(plan.root) + str(claim["root_key"]) != path_key(plan.root) or str(claim["build_id"]) != plan.build_id - or not _same_physical_path(claim_root, plan.root) - or not _same_physical_path(claim_build_root, plan.build_root) + or not same_path(claim_root, plan.root) + or not same_path(claim_build_root, plan.build_root) ): _fail(f"configured output plan does not match its immutable claim: {source}") @staticmethod def _claim_paths( - claim: Mapping[str, Any], source: Path + claim: Mapping[str, Any], source: Path, *, _filesystem: Any = None ) -> tuple[Path, Path]: - claim_root = project_path(Path(str(claim["root"]))) - claim_build_root = project_path(Path(str(claim["build_root"]))) + project = project_path if _filesystem is None else _filesystem.project + path_key = _path_key if _filesystem is None else _filesystem.path_key + claim_root = project(Path(str(claim["root"]))) + claim_build_root = project(Path(str(claim["build_root"]))) if ( - str(claim["root_key"]) != _path_key(claim_root) - or str(claim["build_id"]) != _path_key(claim_build_root) + str(claim["root_key"]) != path_key(claim_root) + or str(claim["build_id"]) != path_key(claim_build_root) ): _fail(f"output claim identity is inconsistent: {source}") return claim_root, claim_build_root @@ -1508,13 +1779,15 @@ def _require_current_plan( ) def _load_recorded_plan( - self, state: Path, claim: Mapping[str, Any] + self, state: Path, claim: Mapping[str, Any], *, _filesystem: Any = None ) -> Plan | None: path = state / "plan.json" if not path.exists(): return None - plan = Plan.from_payload(_load_json(path, "configured output plan"), path) - self._require_plan_claim_binding(plan, claim, path) + plan = Plan.from_payload( + _load_json(path, "configured output plan"), path, _filesystem=_filesystem + ) + self._require_plan_claim_binding(plan, claim, path, _filesystem=_filesystem) return plan @staticmethod @@ -2072,6 +2345,9 @@ def _parse_arguments(arguments: Sequence[str]) -> argparse.Namespace: parser.add_argument("--exec", dest="execution", nargs=argparse.REMAINDER) parser.add_argument("--current-plan", type=Path, action="append", default=[]) parser.add_argument("--retired-plan", type=Path, action="append", default=[]) + parser.add_argument( + "--experimental-registry-index", action="store_true", help=argparse.SUPPRESS + ) return parser.parse_args(arguments) @@ -2086,7 +2362,10 @@ def main(arguments: Sequence[str] | None = None) -> int: return 0 if options.lock_root is None: _fail(f"{options.command} requires --lock-root") - coordinator = OutputCoordinator(options.lock_root) + coordinator = OutputCoordinator( + options.lock_root, + registry_validation="shadow" if options.experimental_registry_index else "reference", + ) if options.command == "reconcile-set": current = [Plan.read(path) for path in options.current_plan] retired = [Plan.read(path) for path in options.retired_plan] diff --git a/cmake/ProtocyteOwnershipIndex.py b/cmake/ProtocyteOwnershipIndex.py new file mode 100644 index 0000000..836426f --- /dev/null +++ b/cmake/ProtocyteOwnershipIndex.py @@ -0,0 +1,122 @@ +"""Experimental ownership geometry, with no mutation or filesystem authority. + +An index describes sampled observations only. It cannot authorize reconciliation +or publication. The coordinator's shadow mode always runs its fresh reference +validator after the preview, and fails closed on disagreement. +""" + +from __future__ import annotations + +from bisect import bisect_left +from dataclasses import dataclass +from typing import Iterable, Literal + + +LocationKey = tuple[int, int, tuple[str, ...]] + + +@dataclass(frozen=True) +class DirectoryObservation: + portable: str + location: LocationKey + ancestors: tuple[LocationKey, ...] + + def overlaps(self, other: DirectoryObservation) -> bool: + return ( + self.portable == other.portable + or self.portable.startswith(other.portable + "/") + or other.portable.startswith(self.portable + "/") + or self.location in other.ancestors + or other.location in self.ancestors + ) + + +@dataclass(frozen=True) +class Reservation: + kind: Literal["root", "staging"] + root_key: str + build_id: str + target: str | None + directory: DirectoryObservation + + +class OwnershipIndex: + """Find overlapping reservations from both lexical and physical geometry. + + Physical ancestors include normalized missing-suffix prefixes. Indexing both + endpoint and ancestor keys covers containment in either direction, including + non-link aliases whose names have no lexical prefix in common. Common + ancestors alone do not imply overlap. + """ + + def __init__(self, reservations: Iterable[Reservation]) -> None: + self.reservations = tuple(reservations) + self.queries = 0 + exact: dict[LocationKey, set[int]] = {} + ancestors: dict[LocationKey, set[int]] = {} + lexical: dict[str, set[int]] = {} + for identifier, reservation in enumerate(self.reservations): + facts = reservation.directory + exact.setdefault(facts.location, set()).add(identifier) + for ancestor in facts.ancestors: + ancestors.setdefault(ancestor, set()).add(identifier) + lexical.setdefault(facts.portable, set()).add(identifier) + self._exact = {key: frozenset(value) for key, value in exact.items()} + self._ancestors = {key: frozenset(value) for key, value in ancestors.items()} + self._lexical = {key: frozenset(value) for key, value in lexical.items()} + self._names = sorted(lexical) + + def overlapping(self, directory: DirectoryObservation) -> tuple[Reservation, ...]: + self.queries += 1 + candidates: set[int] = set(self._ancestors.get(directory.location, ())) + for ancestor in directory.ancestors: + candidates.update(self._exact.get(ancestor, ())) + + current = directory.portable + while True: + candidates.update(self._lexical.get(current, ())) + if "/" not in current: + break + current = current.rsplit("/", 1)[0] + prefix = directory.portable + "/" + position = bisect_left(self._names, prefix) + while position < len(self._names) and self._names[position].startswith(prefix): + candidates.update(self._lexical[self._names[position]]) + position += 1 + # Keep deterministic reporting. The final predicate is also a defensive + # check on candidate retrieval; it uses observations, never fresh I/O. + return tuple( + self.reservations[identifier] + for identifier in sorted(candidates) + if self.reservations[identifier].directory.overlaps(directory) + ) + + def conflict( + self, + *, + root: DirectoryObservation, + root_key: str, + build_id: str, + staging: Iterable[tuple[str, DirectoryObservation]], + retiring_root_keys: set[str], + ) -> str | None: + for reservation in self.overlapping(root): + if reservation.kind == "root": + if reservation.root_key != root_key: + return "root-root" + else: + return "root-staging" + for target, directory in staging: + for reservation in self.overlapping(directory): + if reservation.kind == "root": + return "staging-root" + if target == reservation.target and ( + root_key == reservation.root_key + or ( + reservation.root_key in retiring_root_keys + and build_id == reservation.build_id + ) + ): + continue + return "staging-staging" + return None diff --git a/docs/experimental-index-contract.md b/docs/experimental-index-contract.md new file mode 100644 index 0000000..48dcff8 --- /dev/null +++ b/docs/experimental-index-contract.md @@ -0,0 +1,70 @@ +# Experimental ownership-index contract + +Branch: `codex/experimental-generation-engine`, based on preservation checkpoint +`f804fd1` (`codex/issue-54-registry-scaling`). No remote publication is involved. + +## First experiment + +Implement a portable, filesystem-independent ownership index and bounded sampled +geometry/record authentication behind the existing coordinator entry point. +Initially expose **reference** and **shadow** validation only. The default remains +reference. There is no index-only authorization mode. + +In shadow mode: + +1. Sample and authenticate all records, collect geometry and compute an indexed + preview under the existing registry/generation/publication locks. +2. Discard the sampled index as an authority. Always run the original fresh + registry validator, preserving its comparison order and filesystem checks. +3. Propagate every reference rejection. If the preview rejected a case the + reference accepted, fail before claim initialization or output reconciliation. +4. Publish only path-free diagnostic counts, phase timings and agreement status. + Preview timing is not complete validation timing. Full timings include the + mandatory reference pass, even when that means the experiment is slower. + +The preview never deletes abandoned initialization directories, initializes a +claim, resets ownership or writes generated payloads. Reference reconciliation +retains all mutation/recovery authority. A read-only large preview may be measured +separately, but it must be labeled as an unverified algorithm phase, not as an +under-30-second reconciler. + +## Why a sampled index is not yet authoritative + +An immutable record under the registry lock does not imply immutable filesystem +topology. A foreign missing path can become a link between observations; an +ancestor or physical binding can change and return to its old state. A matching +second metadata sweep is not proof of uninterrupted validity. + +Windows native mechanisms were reviewed before implementation: + +- [CreateFile sharing rules](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew) + can constrain deletion/rename and data-write opens, but attribute access has + distinct rules. An open directory handle is not proof that missing children + cannot appear or that every name-to-object relationship remains unchanged. +- [Directory oplocks](https://learn.microsoft.com/en-us/windows/win32/api/winioctl/ni-winioctl-fsctl_request_oplock) + provide cache invalidation notifications, but changes to enumeration contents + can cause advisory breaks without waiting for acknowledgment. They must not be + treated as an unconditional filesystem write barrier. + +No native guard or watcher will be used as mutation authority without a reviewed +consistency argument and adversarial tests covering its exact semantics. The +current experiment instead has a simple safety argument: every successful +operation still passes the existing fresh validator before any reconciliation +mutation. The preview can add a fail-closed rejection but cannot bypass one. + +## Acceptance and stop boundary + +- Pure geometry index results match an exhaustive predicate across lexical, + physical, missing-ancestor, prefix-boundary and ownership/retirement cases. +- Reference mode retains existing test behavior and its original observations. +- Real mutations between preview and reference, including foreign-path changes, + are rejected by the reference path before new claims are initialized. +- Shadow false positives fail closed; shadow false negatives never bypass the + reference failure. Every retained record participates in both relevant phases. +- Benchmarks identify the requested/effective mode, preview/reference durations, + implementation fingerprints and total filesystem work truthfully. + +The first milestone is a reviewable experimental index with differential and +adversarial evidence. Promotion to authoritative indexed validation, packaging +refactoring and the public generation CLI remain gated on the filesystem-lifetime +proof. Correctness takes precedence over meeting a timing threshold. diff --git a/docs/experimental-index-results.json b/docs/experimental-index-results.json new file mode 100644 index 0000000..05952a2 --- /dev/null +++ b/docs/experimental-index-results.json @@ -0,0 +1,259 @@ +{ + "schema_version": 1, + "status": "experimental shadow index; safe under-30-second target NOT achieved", + "preservation_commit": "f804fd1", + "branch": "codex/experimental-generation-engine", + "default_validation": "reference", + "index_only_authorization_available": false, + "notes": [ + "Fresh explicit synthetic fixtures only; no consumer/shared registry accessed.", + "Setup uses real locked initialization/reconciliation helpers; it is excluded from measured validation.", + "Preview measurements are read-only and non-authoritative; full shadow measurements retain the fresh reference pass.", + "All published measurements match the recorded final coordinator/helper source fingerprints.", + "Timings include instrumentation and uncontrolled workstation/cache effects; fresh process does not imply cold OS cache.", + "Equal claim/plan counts do not establish consumer-equivalent filesystem geometry.", + "Total preview projections add fresh JSON-loader projections to sampled geometry projections; they are an operation-count inference.", + "Earlier pilot measurements and a sample affected by source edits are excluded." + ], + "verification": { + "default_python_regression": { + "command": "python -m pytest -q -n 4", + "result": "passed" + }, + "cmake_integration": { + "passed": 17, + "skipped": 1 + }, + "shadow_coordinator": { + "passed": 87, + "skipped": 6 + }, + "python_312_coordinator_and_index": { + "passed": 113, + "skipped": 6 + }, + "new_index_tests": 26 + }, + "measurements": { + "preview_256": { + "scope": "read-only sampled algorithm; NOT reference verified or authorized", + "reference_validation_performed": false, + "reconciliation_authorized": false, + "tokens_produced": 0, + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "c5df9de17a3c5f5f715ffd8c0944eb45444450113a4fa529139b7cdb31f1efb2", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38" + }, + "timings_include_instrumentation": true, + "retained_claims": 256, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "setup_wall_seconds": 38.34785110002849, + "setup_cpu_seconds": 20.640625, + "lock_preparation_and_wait_seconds": 0.45253629999933764, + "current_plan_validation_seconds": 1.361329699982889, + "preview_wall_seconds": 3.3018979000044055, + "preview_cpu_seconds": 2.71875, + "preview_filesystem_calls": { + "nt.stat": 24174, + "nt.lstat": 1841, + "nt._getfinalpathname": 2612 + }, + "index_experiment": { + "mode": "preview-only", + "authoritative": "none", + "preview_claims": 256, + "preview_records_read": 512, + "preview_unclaimed_states": 0, + "indexed_reservations": 512, + "index_queries": 22, + "sampled_geometry_projections": 794, + "sampled_directory_observations": 538 + }, + "total_preview_path_projections_inferred": 1306 + }, + "preview_2172": { + "scope": "read-only sampled algorithm; NOT reference verified or authorized", + "reference_validation_performed": false, + "reconciliation_authorized": false, + "tokens_produced": 0, + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "c5df9de17a3c5f5f715ffd8c0944eb45444450113a4fa529139b7cdb31f1efb2", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38" + }, + "timings_include_instrumentation": true, + "retained_claims": 2172, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "setup_wall_seconds": 372.5879960000166, + "setup_cpu_seconds": 186.453125, + "lock_preparation_and_wait_seconds": 0.6658470000256784, + "current_plan_validation_seconds": 1.1836236999952234, + "preview_wall_seconds": 28.48035039997194, + "preview_cpu_seconds": 22.3125, + "preview_filesystem_calls": { + "nt.stat": 200446, + "nt.lstat": 15253, + "nt._getfinalpathname": 21772 + }, + "index_experiment": { + "mode": "preview-only", + "authoritative": "none", + "preview_claims": 2172, + "preview_records_read": 4344, + "preview_unclaimed_states": 0, + "indexed_reservations": 4344, + "index_queries": 22, + "sampled_geometry_projections": 6542, + "sampled_directory_observations": 4370 + }, + "total_preview_path_projections_inferred": 10886 + }, + "preview_existing_multi": { + "scope": "read-only sampled algorithm; NOT reference verified or authorized", + "reference_validation_performed": false, + "reconciliation_authorized": false, + "tokens_produced": 0, + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "c5df9de17a3c5f5f715ffd8c0944eb45444450113a4fa529139b7cdb31f1efb2", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38" + }, + "timings_include_instrumentation": true, + "retained_claims": 8, + "current_plans": 11, + "layout": { + "targets_per_plan": 3, + "shared_build_root": true, + "existing_directories": true + }, + "setup_wall_seconds": 1.30061920004664, + "setup_cpu_seconds": 0.78125, + "lock_preparation_and_wait_seconds": 0.3847935000085272, + "current_plan_validation_seconds": 2.5029661000007764, + "preview_wall_seconds": 0.2400352000258863, + "preview_cpu_seconds": 0.203125, + "preview_filesystem_calls": { + "nt.stat": 2185, + "nt.lstat": 98, + "nt._getfinalpathname": 194 + }, + "index_experiment": { + "mode": "preview-only", + "authoritative": "none", + "preview_claims": 8, + "preview_records_read": 16, + "preview_unclaimed_states": 0, + "indexed_reservations": 32, + "index_queries": 44, + "sampled_geometry_projections": 81, + "sampled_directory_observations": 80 + }, + "total_preview_path_projections_inferred": 97 + }, + "shadow_existing_multi": { + "platform": "Windows", + "python": "3.12.9", + "timings_include_instrumentation": true, + "setup_method": "private locked initialization/reconciliation (issue #54 POC)", + "coordinator_sha256": { + "candidate": "c5df9de17a3c5f5f715ffd8c0944eb45444450113a4fa529139b7cdb31f1efb2" + }, + "implementation_files": { + "candidate": { + "ProtocyteOutputCoordinator.py": "c5df9de17a3c5f5f715ffd8c0944eb45444450113a4fa529139b7cdb31f1efb2", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38" + } + }, + "samples": [ + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 8, + "current_plans": 11, + "layout": { + "targets_per_plan": 3, + "shared_build_root": true, + "existing_directories": true + }, + "seed_wall_seconds": 1.6187621999997646, + "seed_cpu_seconds": 1.03125, + "validation_wall_seconds": 9.143145899986848, + "validation_cpu_seconds": 7.46875, + "reconcile_wall_seconds": 13.890712999971583, + "reconcile_cpu_seconds": 11.4375, + "lock_wait_wall_seconds": 0.26127159991301596, + "registry_lock_held_wall_seconds": 13.852026400039904, + "current_plan_validation_wall_seconds": 3.316249900031835, + "validation_engine": "shadow", + "index_experiment": { + "mode": "shadow", + "authoritative": "reference", + "preview_wall_seconds": 0.33316159999230877, + "reference_wall_seconds": 8.809812899969984, + "agreement": true, + "preview_claims": 8, + "preview_records_read": 16, + "preview_unclaimed_states": 0, + "indexed_reservations": 32, + "index_queries": 44, + "sampled_geometry_projections": 81, + "sampled_directory_observations": 80, + "preview_result": "accepted", + "reference_result": "accepted" + }, + "shadow_candidate_wall_seconds": 0.33316159999230877, + "reference_validation_wall_seconds": 8.809812899969984, + "registry_validations": 1, + "registry_scans": 2, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 3430, + "path_projections_total": 5872, + "validation_filesystem_calls": { + "nt.stat": 84391, + "nt.lstat": 3432, + "nt._getfinalpathname": 6860 + }, + "completed_plans": 11 + } + ], + "medians": [ + { + "retained_claims": 8, + "current_plans": 11, + "candidate": { + "seed_wall_seconds": 1.6187621999997646, + "seed_cpu_seconds": 1.03125, + "validation_wall_seconds": 9.143145899986848, + "validation_cpu_seconds": 7.46875, + "reconcile_wall_seconds": 13.890712999971583, + "reconcile_cpu_seconds": 11.4375, + "lock_wait_wall_seconds": 0.26127159991301596, + "registry_lock_held_wall_seconds": 13.852026400039904, + "current_plan_validation_wall_seconds": 3.316249900031835, + "shadow_candidate_wall_seconds": 0.33316159999230877, + "reference_validation_wall_seconds": 8.809812899969984, + "registry_validations": 1, + "registry_scans": 2, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 3430, + "path_projections_total": 5872 + } + } + ] + } + } +} diff --git a/docs/experimental-index-results.md b/docs/experimental-index-results.md new file mode 100644 index 0000000..4d24edf --- /dev/null +++ b/docs/experimental-index-results.md @@ -0,0 +1,108 @@ +# Ownership-index experiment + +The experiment is on `codex/experimental-generation-engine`, directly above +preservation commit `f804fd1` on `codex/issue-54-registry-scaling`. The preceding +work was committed before branching; no remote publication or consumer-registry +maintenance was performed. + +## Result and limit + +At **2,172 retained claims and 11 current plans**, the read-only sampled index +took **28.480 s**, with another **1.184 s** for ordinary current-plan validation: +**29.664 s** combined. It read all **4,344 claim/plan records** and indexed all +**4,344 root/staging reservations**. Setup took **372.588 s** separately; lock +preparation/acquisition took **0.666 s** separately. + +This is an algorithm-phase result, **not a safe under-30-second reconciler**. +That run did not execute the fresh registry reference pass after setup, authorize +reconciliation or produce claim tokens. The reported 751.875-second consumer +observation was not rerun, and equal claim/plan counts do not calibrate the +synthetic filesystem layout to the consumer workload. + +The only executable validation modes remain `reference` (default) and `shadow`. +Shadow always performs the fresh reference pass before proceeding, and fails +closed on disagreement. Thus the deployed/default behavior has no claimed +large-case speedup from this experiment, and shadow adds measurement work. + +## Implementation + +- A pure Python index retrieves possible conflicts using lexical prefixes and + physical endpoint/ancestor keys, including normalized missing suffixes. It + preserves ownership and retirement exemptions and performs no filesystem I/O. +- One scoped preview authenticates retained records and collects bounded sampled + geometry. Samples are discarded when the preview ends. They cannot authorize + initialization, reconciliation, retirement or publication. +- Shadow runs behind the existing coordinator entry point and lock order. Every + reference rejection is preserved; preview failure cannot grant authority. + Diagnostics contain counts, timings and agreement, without private paths. +- The optional helper installs beside the coordinator. An actual installed, + relocated-prefix test exercises shadow mode and verifies that the entire + package prefix remains unchanged, including absence of bytecode-cache writes. +- Full benchmark/POC shadow modes retain all checks. A separate read-only tool + labels its unverified scope explicitly. Measurements fingerprint both source + files and reject a run if either changes while it is being measured. + +Existing CMake helpers and normal installation/build commands require no new +configuration. The broader Python packaging and public generation CLI changes +remain a later stage of [the engine proposal](generation-engine-proposal.md). + +## Work counts and measurements + +The exact-size preview made **6,542 sampled geometry projections** and **4,370 +directory observations**, then answered **22 index queries**. Geometry projections +exclude the original JSON-loader path checks. Including the two fresh JSON-path +projections per claim gives **10,886 total projections** for this fixture. +Compare that with the prior reference operation-count inference of **254,257** +for this shape: about **23.4 times fewer projections**, not a measured end-to-end +wall-time ratio. There were still **200,446 `stat`**, **15,253 `lstat`**, and +**21,772 final-path** calls in the preview, so filesystem work remains substantial. + +A full shadow sample with eight retained claims, eleven current plans, three +targets per plan, existing root/staging directories and one shared build root +accepted in both phases. It checked 16 records in each phase and indexed 32 +reservations. The sampled phase took **0.333 s**, fresh registry reference +validation **8.810 s**, and current-plan validation **3.316 s**. Full +reconciliation took **13.891 s**, including locks and output-state reconciliation. +Those costs have not been hidden in the preview number. + +The sanitized source fingerprints, complete phase metrics, 256-claim scaling +sample and anonymous layout variants are in +[experimental-index-results.json](experimental-index-results.json). Measurements +used CPython 3.12.9 on Windows, include instrumentation, and are individual +workstation samples. A fresh fixture/process does not imply a cold OS cache. +The exact-size run leaves essentially no margin for a safe lifetime mechanism +or slower layouts; it also misses the proposed 25-second research budget. + +## Correctness evidence + +- The full default Python regression suite passed, followed by **17 passed, + 1 skipped** CMake integration tests. +- The existing coordinator suite in shadow mode passed: **87 passed, 6 skipped**. +- Python 3.12 coordinator/index compatibility checks passed: **113 passed, + 6 skipped**. These include 26 new index tests. +- Fixed-seed differential tests compare indexed results to exhaustive geometry + across aliases, missing suffixes and prefix boundaries. Focused tests cover + ownership/retirement exemptions and disjoint-query scaling. +- Injected foreign root, staging and ancestor replacements, plus a simulated + physical alias introduced after sampling, are rejected by fresh reference + validation before new claims are initialized. Injected preview false positives, + false negatives and parser errors cannot authorize a mutation. +- Read-only-preview tests prohibit filesystem mutation, retain abandoned state, + enforce sample expiry and preserve the CLI token protocol. + +These tests establish the safety of retaining reference authority. They do not +prove that sampled topology remains valid or that index-only operation is safe. + +## Promotion gate + +The remaining problem is the filesystem-observation lifetime, described in +[the experimental contract](experimental-index-contract.md). A registry lock +does not prevent foreign paths from changing. A second matching metadata sweep +or a filesystem watcher is insufficient to establish continuous validity. + +Before removing the reference pass, define and review a mechanism that preserves +all relevant name/object/missing-component bindings through the mutation +boundary, with bounded fail-closed recovery. Test its exact race and alias +semantics, then measure **all** its work on the large case and representative +layouts. The fast preview alone provides neither that proof nor enough timing +margin. No index-only authorization switch is provided in this experiment. diff --git a/docs/generation-engine-proposal.md b/docs/generation-engine-proposal.md index 7213411..8c08336 100644 --- a/docs/generation-engine-proposal.md +++ b/docs/generation-engine-proposal.md @@ -230,5 +230,8 @@ Those would obscure whether the algorithm is faster and whether safety survived. Internal task manifests, registry maintenance and performance switches stay out of the required user workflow. -This document is an implementation proposal. The new CLI and packaged backend -described here have not been implemented, and the 30-second target is not yet proven. +The first experimental core now exists behind the current entry point in shadow +mode; see [its results](experimental-index-results.md) and +[authority contract](experimental-index-contract.md). The new CLI and packaged +backend described here have not been implemented, and the safe 30-second target +is not yet proven. diff --git a/docs/registry-validation-30s-plan.md b/docs/registry-validation-30s-plan.md index 94f6c8b..f43558d 100644 --- a/docs/registry-validation-30s-plan.md +++ b/docs/registry-validation-30s-plan.md @@ -169,4 +169,7 @@ active validation work. Clearing retained claims, dropping physical checks, changing the shared namespace or relaxing safety to meet a timing gate are not part of this plan. -No production coordinator logic was changed for this feasibility assessment. +This feasibility assessment preceded the implementation. A subsequent +[ownership-index experiment](experimental-index-results.md) measured the +read-only sampled phase at the exact claim/plan count. Its shadow mode retains +fresh reference authority; it has not achieved safe under-30-second validation. diff --git a/docs/wiki/Contributing.md b/docs/wiki/Contributing.md index d3798d9..ab2ce20 100644 --- a/docs/wiki/Contributing.md +++ b/docs/wiki/Contributing.md @@ -96,6 +96,35 @@ pytest fixtures use a per-test cache base even when exercising the default registry selector. Retained claims are released only by an ownership-aware reset, never by age, missing build trees or test-looking names. +The experimental ownership index supports a `shadow` benchmark mode. It runs +both the sampled preview and the mandatory fresh reference validator; full +validation timings include both. Baseline checkouts use reference mode: + +```bash +python tests/benchmark_output_registry.py --registry-validation shadow --claims 0 8 16 --plans 1 11 --repeat 1 +python tests/registry_validation_poc.py --registry-validation shadow --claims 0 8 16 --plans 1 11 +``` + +The scaling benchmark also accepts `--targets-per-plan 3 --shared-build-root +--existing-directories` to exercise anonymous alternate layouts. Both sides of a +baseline comparison use the same layout. The defaults preserve the original +one-target, separate-build, absent-directory fixture. + +A separate **read-only, non-authoritative** experiment measures only the sampled +algorithm. It performs no fresh registry reference pass after seeding and grants +no authority to reconcile or publish; its timing is not a reconciler speedup: + +```bash +python tests/benchmark_ownership_preview.py --large --claims 2172 --plans 11 --work .pytest-tmp/index-preview-new +``` + +The work directory must be new. The preview supports the same layout flags. +Both tools record the coordinator/helper fingerprints and reject source changes +during a measurement. See the experiment's +[results](../experimental-index-results.md) and +[correctness contract](../experimental-index-contract.md) before interpreting +the preview numbers. The default coordinator remains reference mode. + ## Documentation The canonical wiki source is `docs/wiki/` in the main repository. Edit and diff --git a/tests/benchmark_output_registry.py b/tests/benchmark_output_registry.py index b82c25e..8d08959 100644 --- a/tests/benchmark_output_registry.py +++ b/tests/benchmark_output_registry.py @@ -19,6 +19,7 @@ import argparse import cProfile +import contextlib import hashlib import importlib.util import json @@ -41,48 +42,125 @@ def _load(source: Path, label: str) -> ModuleType: module = importlib.util.module_from_spec(spec) sys.modules[spec.name] = module spec.loader.exec_module(module) + module._benchmark_implementation_files = _implementation_fingerprint(module) return module -def _plan(module: ModuleType, work: Path, name: str) -> Any: +def _plan( + module: ModuleType, + work: Path, + name: str, + *, + targets_per_plan: int = 1, + shared_build_root: bool = False, +) -> Any: directory = work / name - build = directory / "build" - build.mkdir(parents=True) - target = hashlib.sha256(name.encode()).hexdigest() - staging = directory / f".protocyte-generation-staging-{target}" + build = work / "shared-build" if shared_build_root else directory / "build" + directory.mkdir(parents=True, exist_ok=True) + build.mkdir(parents=True, exist_ok=shared_build_root) path = directory / "outputs.plan" def encode(value: Path | str) -> str: return os.fspath(value).encode("utf-8").hex() - path.write_text( - "\n".join( + lines = [ + module.PLAN_HEADER, + "root-hex=" + encode(directory / "generated"), + "build-root-hex=" + encode(build), + ] + for number in range(targets_per_plan): + target_name = name if number == 0 else f"{name}/target-{number}" + target = hashlib.sha256(target_name.encode()).hexdigest() + staging = directory / f".protocyte-generation-staging-{target}" + relative = ( + "sample.protocyte.hpp" if number == 0 else f"sample-{number}.protocyte.hpp" + ) + lines.extend( [ - module.PLAN_HEADER, - "root-hex=" + encode(directory / "generated"), - "build-root-hex=" + encode(build), "target=" + target + "|" + encode(staging), - "output=" + target + "|" + encode("sample.protocyte.hpp"), + "output=" + target + "|" + encode(relative), ] ) - + "\n", - encoding="ascii", - ) + path.write_text("\n".join(lines) + "\n", encoding="ascii") return module.Plan.read(path) -def _sample(module: ModuleType, work: Path, claims: int, plans: int) -> dict[str, Any]: +def _implementation_fingerprint(module: ModuleType) -> dict[str, str]: + paths = [Path(module.__file__)] + helper = paths[0].with_name("ProtocyteOwnershipIndex.py") + if helper.is_file(): + paths.append(helper) + return {path.name: hashlib.sha256(path.read_bytes()).hexdigest() for path in paths} + + +def _filesystem_counts(profile: cProfile.Profile) -> dict[str, int]: + filesystem_calls = {} + for (_, _, name), (_, calls, _, _, _) in pstats.Stats(profile).stats.items(): + for operation in ( + "nt.stat", + "nt.lstat", + "nt._getfinalpathname", + "nt._path_lexists", + "posix.stat", + "posix.lstat", + ): + if name == f"": + filesystem_calls[operation] = calls + if name == "_windows_file_attributes": + # ctypes native calls are opaque to cProfile. Include their probe + # helper; replacing lstat does not eliminate filesystem queries. + filesystem_calls["windows_attribute_probes"] = calls + return filesystem_calls + + +def _prepare_fixture( + module: ModuleType, + work: Path, + claims: int, + plans: int, + *, + registry_validation: str = "reference", + targets_per_plan: int = 1, + shared_build_root: bool = False, + existing_directories: bool = False, +) -> tuple[Any, list[Any], float, float]: wall, cpu = time.perf_counter(), time.process_time() work.mkdir(parents=True, exist_ok=False) - engine = module.OutputCoordinator(work / "isolated-registry") - retained = [_plan(module, work, f"retained-{i:04}") for i in range(claims)] - current = [_plan(module, work, f"current-{i:04}") for i in range(plans)] + engine = ( + module.OutputCoordinator(work / "isolated-registry") + if registry_validation == "reference" + else module.OutputCoordinator( + work / "isolated-registry", registry_validation=registry_validation + ) + ) + layout = { + "targets_per_plan": targets_per_plan, + "shared_build_root": shared_build_root, + } + retained = [ + _plan(module, work, f"retained-{i:04}", **layout) for i in range(claims) + ] + current = [_plan(module, work, f"current-{i:04}", **layout) for i in range(plans)] + if existing_directories: + for plan in (*retained, *current): + plan.root.mkdir() + for target in plan.targets: + target.staging.mkdir() # Setup only, as in issue #54's POC. Seed disjoint synthetic fixtures through # the real private locked helpers, avoiding all-pairs fixture validation. # The measured reconcile_set below is unchanged and skips no checks. module._durable_mkdir(engine.lock_root) - with module.FileLock(engine.lock_root / "registry.lock"): - for plan in retained: + reporter = ( + module._ReconcileProgress(plans, 0) + if hasattr(module, "_ReconcileProgress") + else contextlib.nullcontext(None) + ) + with reporter as progress, module.FileLock(engine.lock_root / "registry.lock"): + if progress is not None: + progress.phase( + f"fixture setup (0/{claims} claims seeded)", "reconciliation" + ) + for number, plan in enumerate(retained, start=1): with ( module.FileLock(engine._generation_lock(plan.root)), module.FileLock(engine._publication_lock(plan.root)), @@ -90,8 +168,39 @@ def _sample(module: ModuleType, work: Path, claims: int, plans: int) -> dict[str state = engine._state_directory(plan.root) engine._initialize_claim_locked(state, plan) engine._reconcile_locked(state, plan) + if progress is not None: + progress.phase( + f"fixture setup ({number}/{claims} claims seeded)", "reconciliation" + ) seed_wall = time.perf_counter() - wall seed_cpu = time.process_time() - cpu + return engine, current, seed_wall, seed_cpu + + +def _sample( + module: ModuleType, + work: Path, + claims: int, + plans: int, + *, + registry_validation: str = "reference", + targets_per_plan: int = 1, + shared_build_root: bool = False, + existing_directories: bool = False, +) -> dict[str, Any]: + expected_sources = getattr(module, "_benchmark_implementation_files", None) + if expected_sources is None: + expected_sources = _implementation_fingerprint(module) + engine, current, seed_wall, seed_cpu = _prepare_fixture( + module, + work, + claims, + plans, + registry_validation=registry_validation, + targets_per_plan=targets_per_plan, + shared_build_root=shared_build_root, + existing_directories=existing_directories, + ) counts = { "registry_validations": 0, "registry_scans": 0, @@ -184,25 +293,19 @@ def scandir(path: Any) -> Any: module.project_path = original_project module.os.scandir = original_scandir assert len(tokens) == plans and all(tokens) - filesystem_calls = {} - for (_, _, name), (_, calls, _, _, _) in pstats.Stats(profile).stats.items(): - for operation in ( - "nt.stat", - "nt.lstat", - "nt._getfinalpathname", - "nt._path_lexists", - "posix.stat", - "posix.lstat", - ): - if name == f"": - filesystem_calls[operation] = calls - if name == "_windows_file_attributes": - # ctypes native calls are opaque to cProfile. Count their fresh - # probe helper too; replacing lstat does not eliminate FS queries. - filesystem_calls["windows_attribute_probes"] = calls + if _implementation_fingerprint(module) != expected_sources: + raise RuntimeError( + "coordinator sources changed during the sample; discard its timings" + ) + filesystem_calls = _filesystem_counts(profile) return { "retained_claims": claims, "current_plans": plans, + "layout": { + "targets_per_plan": targets_per_plan, + "shared_build_root": shared_build_root, + "existing_directories": existing_directories, + }, "seed_wall_seconds": seed_wall, "seed_cpu_seconds": seed_cpu, "validation_wall_seconds": validation_wall, @@ -212,6 +315,14 @@ def scandir(path: Any) -> Any: "lock_wait_wall_seconds": lock_wait, "registry_lock_held_wall_seconds": registry_held, "current_plan_validation_wall_seconds": current_validation, + "validation_engine": registry_validation, + "index_experiment": getattr(engine, "validation_metrics", {}), + "shadow_candidate_wall_seconds": getattr(engine, "validation_metrics", {}).get( + "preview_wall_seconds", 0.0 + ), + "reference_validation_wall_seconds": getattr( + engine, "validation_metrics", {} + ).get("reference_wall_seconds", validation_wall), **counts, "validation_filesystem_calls": filesystem_calls, "completed_plans": len(tokens), @@ -228,8 +339,15 @@ def main() -> None: parser.add_argument("--plans", type=int, nargs="+", default=[1, 4]) parser.add_argument("--repeat", type=int, default=3) parser.add_argument("--work", type=Path) + parser.add_argument("--targets-per-plan", type=int, default=1) + parser.add_argument("--shared-build-root", action="store_true") + parser.add_argument("--existing-directories", action="store_true") + parser.add_argument( + "--registry-validation", choices=("reference", "shadow"), default="reference" + ) parser.add_argument( - "--large", action="store_true", + "--large", + action="store_true", help="opt into 129..4096 retained claims (setup and validation may take minutes)", ) args = parser.parse_args() @@ -241,6 +359,8 @@ def main() -> None: parser.error("expected 0..4096 claims, 1..32 plans, and 1..20 repetitions") if max(args.claims) > 128 and not args.large: parser.error("more than 128 claims requires explicit --large opt-in") + if not 1 <= args.targets_per_plan <= 8: + parser.error("expected 1..8 targets per plan") sources = {"candidate": args.source.resolve()} if args.baseline_source: sources = {"baseline": args.baseline_source.resolve(), **sources} @@ -262,6 +382,10 @@ def main() -> None: label: hashlib.sha256(Path(module.__file__).read_bytes()).hexdigest() for label, module in modules.items() }, + "implementation_files": { + label: _implementation_fingerprint(module) + for label, module in modules.items() + }, "samples": [], "medians": [], } @@ -287,7 +411,18 @@ def main() -> None: sample = { "revision": label, "repetition": repetition, - **_sample(modules[label], sample_work, claims, plans), + **_sample( + modules[label], + sample_work, + claims, + plans, + registry_validation=args.registry_validation + if label == "candidate" + else "reference", + targets_per_plan=args.targets_per_plan, + shared_build_root=args.shared_build_root, + existing_directories=args.existing_directories, + ), } result["samples"].append(sample) print(json.dumps(sample), flush=True) diff --git a/tests/benchmark_ownership_preview.py b/tests/benchmark_ownership_preview.py new file mode 100644 index 0000000..e4456d7 --- /dev/null +++ b/tests/benchmark_ownership_preview.py @@ -0,0 +1,128 @@ +"""Read-only sampled-index experiment, NOT an authoritative validation benchmark. + +Uses the standard scaling benchmark's isolated fixture setup and ordinary locks. +Only the unverified preview algorithm is measured: no reference validation, +reconciliation or publication is performed after seeding. Preview timings cannot +be reported as a complete reconciler speedup. Publish only results.json, never +fixture directories or claim records containing local paths. +""" + +from __future__ import annotations + +import argparse +import cProfile +import contextlib +import json +import platform +import tempfile +import time +from pathlib import Path + +from benchmark_output_registry import ( + _filesystem_counts, + _implementation_fingerprint, + _load, + _prepare_fixture, +) + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--claims", type=int, default=64) + parser.add_argument("--plans", type=int, default=11) + parser.add_argument("--large", action="store_true") + parser.add_argument("--work", type=Path) + parser.add_argument("--targets-per-plan", type=int, default=1) + parser.add_argument("--shared-build-root", action="store_true") + parser.add_argument("--existing-directories", action="store_true") + args = parser.parse_args() + if not 0 <= args.claims <= 4096 or not 1 <= args.plans <= 32: + parser.error("expected 0..4096 claims and 1..32 plans") + if args.claims > 128 and not args.large: + parser.error("more than 128 claims requires explicit --large opt-in") + if not 1 <= args.targets_per_plan <= 8: + parser.error("expected 1..8 targets per plan") + if args.work: + work = args.work.absolute() + work.mkdir(parents=True, exist_ok=False) + else: + work = Path(tempfile.mkdtemp(prefix="protocyte-index-preview-")) + module = _load(Path(__file__).resolve().parents[1], "preview_only") + implementation_files = _implementation_fingerprint(module) + engine, current, setup_wall, setup_cpu = _prepare_fixture( + module, + work / "sample", + args.claims, + args.plans, + targets_per_plan=args.targets_per_plan, + shared_build_root=args.shared_build_root, + existing_directories=args.existing_directories, + ) + profile = cProfile.Profile() + started = time.perf_counter() + with ( + module._ReconcileProgress(len(current), 0) as progress, + contextlib.ExitStack() as locks, + ): + progress.phase("waiting for preview locks", "lock_wait") + locks.enter_context(module.FileLock(engine.lock_root / "registry.lock")) + roots = {module._path_key(plan.root): plan.root for plan in current} + for root in sorted(roots.values(), key=module._portable_identity): + locks.enter_context(module.FileLock(engine._generation_lock(root))) + for root in sorted(roots.values(), key=module._portable_identity): + locks.enter_context(module.FileLock(engine._publication_lock(root))) + lock_seconds = time.perf_counter() - started + progress.phase("checking current plans for read-only preview", "validation") + started = time.perf_counter() + engine._validate_plan_set(current) + current_seconds = time.perf_counter() - started + engine.validation_metrics = {"mode": "preview-only", "authoritative": "none"} + progress.phase("read-only experimental ownership preview", "validation") + started, cpu = time.perf_counter(), time.process_time() + profile.enable() + try: + accepted = engine._preview_registry_index(current, set(), progress=progress) + finally: + profile.disable() + preview_seconds = time.perf_counter() - started + preview_cpu = time.process_time() - cpu + assert accepted and engine.validation_metrics["preview_claims"] == args.claims + assert engine.validation_metrics["preview_records_read"] == 2 * args.claims + assert len(list((engine.lock_root / "roots").glob("*/claim.json"))) == args.claims + if _implementation_fingerprint(module) != implementation_files: + raise RuntimeError( + "coordinator sources changed during the preview; discard its timings" + ) + result = { + "scope": "read-only sampled algorithm; NOT reference verified or authorized", + "reference_validation_performed": False, + "reconciliation_authorized": False, + "tokens_produced": 0, + "platform": platform.system(), + "python": platform.python_version(), + "implementation_files": implementation_files, + "timings_include_instrumentation": True, + "retained_claims": args.claims, + "current_plans": args.plans, + "layout": { + "targets_per_plan": args.targets_per_plan, + "shared_build_root": args.shared_build_root, + "existing_directories": args.existing_directories, + }, + "setup_wall_seconds": setup_wall, + "setup_cpu_seconds": setup_cpu, + "lock_preparation_and_wait_seconds": lock_seconds, + "current_plan_validation_seconds": current_seconds, + "preview_wall_seconds": preview_seconds, + "preview_cpu_seconds": preview_cpu, + "preview_filesystem_calls": _filesystem_counts(profile), + "index_experiment": engine.validation_metrics, + } + (work / "results.json").write_text( + json.dumps(result, indent=2) + "\n", encoding="utf-8" + ) + print(json.dumps(result), flush=True) + + +if __name__ == "__main__": + main() diff --git a/tests/registry_validation_poc.py b/tests/registry_validation_poc.py index e2d0694..231462a 100644 --- a/tests/registry_validation_poc.py +++ b/tests/registry_validation_poc.py @@ -67,11 +67,19 @@ def encoded(value): return module.Plan.read(path) -def sample(module, work, retained_count, current_count): +def sample( + module, work, retained_count, current_count, registry_validation="reference" +): setup_start = time.perf_counter() retained = [plan(module, work, "retained-%04d" % i) for i in range(retained_count)] current = [plan(module, work, "current-%04d" % i) for i in range(current_count)] - engine = module.OutputCoordinator(work / "isolated-registry") + engine = ( + module.OutputCoordinator(work / "isolated-registry") + if registry_validation == "reference" + else module.OutputCoordinator( + work / "isolated-registry", registry_validation=registry_validation + ) + ) # Fixture seeding only: avoid quadratic conflict comparisons during setup. # Use real initialization/reconciliation helpers under PRIVATE locks. @@ -172,6 +180,8 @@ def counted(*args, _name=name, _original=original, **kwargs): "validation_operation_counts": counts, "validation_filesystem_calls": filesystem, "completed_plans": len(tokens), + "validation_engine": registry_validation, + "index_experiment": getattr(engine, "validation_metrics", {}), } @@ -221,6 +231,9 @@ def main(): parser.add_argument("--plans", type=int, nargs="+", default=[1, 11]) parser.add_argument("--repeat", type=int, default=1) parser.add_argument("--work", type=Path) + parser.add_argument( + "--registry-validation", choices=("reference", "shadow"), default="reference" + ) args = parser.parse_args() if ( any(not 0 <= n <= 4096 for n in args.claims) @@ -240,6 +253,11 @@ def main(): "os": platform.system(), "python": platform.python_version(), "coordinator_sha256": hashlib.sha256(source.read_bytes()).hexdigest(), + "implementation_files": { + path.name: hashlib.sha256(path.read_bytes()).hexdigest() + for path in (source, source.with_name("ProtocyteOwnershipIndex.py")) + if path.is_file() + }, "timings_include_instrumentation": True, "samples": [], } @@ -247,7 +265,19 @@ def main(): for claims in args.claims: for plans in args.plans: work = root / ("r%d-c%d-p%d" % (repetition, claims, plans)) - row = {"repetition": repetition, **sample(module, work, claims, plans)} + row = { + "repetition": repetition, + **sample(module, work, claims, plans, args.registry_validation), + } + observed_files = { + path.name: hashlib.sha256(path.read_bytes()).hexdigest() + for path in (source, source.with_name("ProtocyteOwnershipIndex.py")) + if path.is_file() + } + if observed_files != result["implementation_files"]: + raise RuntimeError( + "coordinator sources changed during the POC; discard timings" + ) result["samples"].append(row) print(json.dumps(row), flush=True) result["progress_demo"] = progress_demo(module) diff --git a/tests/test_output_coordinator.py b/tests/test_output_coordinator.py index 68eb0b4..385750f 100644 --- a/tests/test_output_coordinator.py +++ b/tests/test_output_coordinator.py @@ -23,6 +23,16 @@ def _load_coordinator() -> ModuleType: module = importlib.util.module_from_spec(specification) sys.modules[specification.name] = module specification.loader.exec_module(module) + test_mode = os.environ.get("PROTOCYTE_TEST_REGISTRY_VALIDATION", "reference") + if test_mode != "reference": + original_initialize = module.OutputCoordinator.__init__ + + def initialize( + self: object, lock_root: Path, *, registry_validation: str = test_mode + ) -> None: + original_initialize(self, lock_root, registry_validation=registry_validation) + + module.OutputCoordinator.__init__ = initialize return module @@ -1627,7 +1637,9 @@ def plan(name: str) -> object: retained = [plan(f"retained-{index}") for index in range(4)] current = [plan(f"current-{index}") for index in range(current_count)] - engine = coordinator.OutputCoordinator(tmp_path / "locks") + # This is the production reference contract; shadow deliberately reads each + # record once in its preview and once in the mandatory reference phase. + engine = coordinator.OutputCoordinator(tmp_path / "locks", registry_validation="reference") engine.reconcile_set((), retained) expected = {engine._state_directory(value.root) for value in retained} loaded: list[Path] = [] diff --git a/tests/test_output_coordinator_cmake.py b/tests/test_output_coordinator_cmake.py index 98f75a2..7571dfc 100644 --- a/tests/test_output_coordinator_cmake.py +++ b/tests/test_output_coordinator_cmake.py @@ -1,6 +1,7 @@ from __future__ import annotations import json +import hashlib import importlib.util import os import shutil @@ -44,7 +45,8 @@ def test_default_registry_selector_uses_the_isolated_test_cache(tmp_path: Path) "_protocyte_shared_output_lock_directory(selected)", f'file(WRITE "{result_path.as_posix()}" "${{selected}}")', ] - ) + "\n", + ) + + "\n", encoding="utf-8", ) result = subprocess.run( @@ -54,9 +56,75 @@ def test_default_registry_selector_uses_the_isolated_test_cache(tmp_path: Path) check=False, ) assert result.returncode == 0, result.stdout + result.stderr - assert Path(result_path.read_text()).resolve() == ( - tmp_path / "isolated-user-cache/protocyte/output-locks-v1" - ).resolve() + assert ( + Path(result_path.read_text()).resolve() + == (tmp_path / "isolated-user-cache/protocyte/output-locks-v1").resolve() + ) + + +def test_installed_shadow_coordinator_is_relocatable_and_keeps_prefix_unchanged( + tmp_path: Path, +) -> None: + _, prefix = _test_cmake._configure_fetchcontent_install_fixture( + tmp_path, protocyte_install=True + ) + relocated = tmp_path / "relocated-prefix" + prefix.rename(relocated) + script = next(relocated.rglob("ProtocyteOutputCoordinator.py")) + assert script.with_name("ProtocyteOwnershipIndex.py").is_file() + + def contents() -> dict[str, bytes]: + return { + path.relative_to(relocated).as_posix(): hashlib.sha256( + path.read_bytes() + ).digest() + for path in relocated.rglob("*") + if path.is_file() + } + + before = contents() + build = tmp_path / "consumer-build" + build.mkdir() + root = tmp_path / "generated" + target = hashlib.sha256(b"installed-shadow").hexdigest() + staging = tmp_path / f".protocyte-generation-staging-{target}" + plan = tmp_path / "outputs.plan" + + def encoded(path: Path | str) -> str: + return os.fspath(path).encode().hex() + + plan.write_text( + "\n".join( + [ + "protocyte-output-plan-v1", + "root-hex=" + encoded(root), + "build-root-hex=" + encoded(build), + "target=" + target + "|" + encoded(staging), + "output=" + target + "|" + encoded("sample.protocyte.hpp"), + ] + ) + + "\n", + encoding="ascii", + ) + result = subprocess.run( + [ + sys.executable, + str(script), + "reconcile", + "--lock-root", + str(tmp_path / "locks"), + "--plan", + str(plan), + "--experimental-registry-index", + ], + check=False, + capture_output=True, + text=True, + ) + assert result.returncode == 0, result.stdout + result.stderr + assert len(result.stdout.strip()) == 64 + assert len(result.stdout.splitlines()) == 1 + assert contents() == before def test_coordinator_recovers_default_output_after_build_tree_recreation( @@ -213,7 +281,8 @@ def test_configure_surfaces_lock_progress_without_corrupting_claim_tokens( assert time.monotonic() < deadline, diagnostic time.sleep(0.05) progress_lines = [ - line for line in diagnostic.splitlines() + line + for line in diagnostic.splitlines() if "Protocyte output coordinator:" in line ] assert progress_lines and all( @@ -307,7 +376,8 @@ def test_reconfigure_retires_interrupted_staging_for_a_removed_target( assert configured.returncode == 0, configured.stdout + configured.stderr plan = next((build / "CMakeFiles" / "protocyte-output-plans").glob("*.plan")) target_line = next( - line for line in plan.read_text(encoding="ascii").splitlines() + line + for line in plan.read_text(encoding="ascii").splitlines() if line.startswith("target=") ) staging = Path(bytes.fromhex(target_line.split("|", 1)[1]).decode("utf-8")) @@ -359,12 +429,8 @@ def test_conflicting_root_move_preserves_the_last_successful_outputs( second_build = tmp_path / "second-build" second_output = tmp_path / "second-generated" locks = tmp_path / "locks" - _write_out_dir_owner_project( - first_source, first_output, output_lock_root=locks - ) - _write_out_dir_owner_project( - second_source, second_output, output_lock_root=locks - ) + _write_out_dir_owner_project(first_source, first_output, output_lock_root=locks) + _write_out_dir_owner_project(second_source, second_output, output_lock_root=locks) assert _configure(first_source, first_build).returncode == 0 assert _build_out_dir_owner_project(first_build).returncode == 0 assert _configure(second_source, second_build).returncode == 0 @@ -375,9 +441,7 @@ def test_conflicting_root_move_preserves_the_last_successful_outputs( prior_plan_text = prior_plan.read_text(encoding="ascii") first_header = first_output / "demo_0.protocyte.hpp" first_header_bytes = first_header.read_bytes() - _write_out_dir_owner_project( - first_source, second_output, output_lock_root=locks - ) + _write_out_dir_owner_project(first_source, second_output, output_lock_root=locks) rejected = _configure(first_source, first_build) @@ -418,9 +482,7 @@ def test_public_reset_rejects_duplicate_single_value_keywords(tmp_path: Path) -> assert configured.returncode != 0 diagnostic = " ".join((configured.stdout + configured.stderr).split()) - assert ( - "duplicate single-value keyword(s): OUT_DIR, EXPECTED_CLAIM" in diagnostic - ) + assert "duplicate single-value keyword(s): OUT_DIR, EXPECTED_CLAIM" in diagnostic def test_coordinator_skips_an_inherited_incompatible_python(tmp_path: Path) -> None: @@ -451,9 +513,10 @@ def test_coordinator_skips_an_inherited_incompatible_python(tmp_path: Path) -> N ) assert configured.returncode == 0, configured.stdout + configured.stderr - assert Path(result_file.read_text(encoding="utf-8")).resolve() != Path( - shutil.which("cmake") or "" - ).resolve() + assert ( + Path(result_file.read_text(encoding="utf-8")).resolve() + != Path(shutil.which("cmake") or "").resolve() + ) def test_reconfigure_discards_an_already_released_retired_plan( @@ -531,11 +594,13 @@ def test_build_root_is_physical_when_configured_through_a_directory_link( assert configured.returncode == 0, configured.stdout + configured.stderr assert generated.returncode == 0, generated.stdout + generated.stderr - plan = next( - (real_build / "CMakeFiles" / "protocyte-output-plans").glob("*.plan") + plan = next((real_build / "CMakeFiles" / "protocyte-output-plans").glob("*.plan")) + encoded_build_root = ( + plan.read_text(encoding="ascii").splitlines()[2].split("=", 1)[1] + ) + assert ( + Path(bytes.fromhex(encoded_build_root).decode("utf-8")) == real_build.resolve() ) - encoded_build_root = plan.read_text(encoding="ascii").splitlines()[2].split("=", 1)[1] - assert Path(bytes.fromhex(encoded_build_root).decode("utf-8")) == real_build.resolve() def test_public_reset_requires_token_and_releases_claim(tmp_path: Path) -> None: diff --git a/tests/test_ownership_index.py b/tests/test_ownership_index.py new file mode 100644 index 0000000..89d665f --- /dev/null +++ b/tests/test_ownership_index.py @@ -0,0 +1,429 @@ +from __future__ import annotations + +import importlib.util +import random +import sys +from pathlib import Path + +import pytest + +_spec = importlib.util.spec_from_file_location( + "protocyte_ownership_index_test_helpers", + Path(__file__).with_name("test_output_coordinator.py"), +) +assert _spec is not None and _spec.loader is not None +_helpers = importlib.util.module_from_spec(_spec) +sys.modules[_spec.name] = _helpers +_spec.loader.exec_module(_helpers) +_directory_link = _helpers._directory_link +_target = _helpers._target +_write_plan = _helpers._write_plan +coordinator = _helpers.coordinator + + +model = coordinator._load_ownership_index() + + +def _directory(name: str, inode: int, parents: tuple[int, ...] = (1,)) -> object: + key = (7, inode, ()) + return model.DirectoryObservation( + name, key, (key, *((7, parent, ()) for parent in parents)) + ) + + +def _oracle_overlap(first: object, second: object) -> bool: + def contains(parent: str, child: str) -> bool: + return child == parent or child.startswith(parent + "/") + + return ( + contains(first.portable, second.portable) + or contains(second.portable, first.portable) + or any(first.location == key for key in second.ancestors) + or any(second.location == key for key in first.ancestors) + ) + + +def test_index_matches_exhaustive_geometry_across_aliases_and_missing_suffixes() -> ( + None +): + randomizer = random.Random(5411) + parents: dict[int, tuple[int, ...]] = {1: ()} + for inode in range(2, 72): + parent = randomizer.randrange(1, inode) + parents[inode] = (parent, *parents[parent]) + observations = [] + for index in range(300): + inode = randomizer.randrange(1, 72) + suffix = tuple( + randomizer.choice(("nested", "nested-other", "unicode-ü", "leaf")) + for _ in range(randomizer.randrange(4)) + ) + alias = "alias" if index % 3 == 0 else "tree" + name = f"/{alias}/node-{inode}" + ("/" + "/".join(suffix) if suffix else "") + keys = tuple( + (7, inode, suffix[:length]) for length in range(len(suffix), -1, -1) + ) + keys += tuple((7, parent, ()) for parent in parents[inode]) + observations.append(model.DirectoryObservation(name, (7, inode, suffix), keys)) + observations.extend((_directory("", 1, ()), _directory("/tree/node-2-other", 900))) + reservations = tuple( + model.Reservation("root", str(index), "owner", None, facts) + for index, facts in enumerate(observations) + ) + index = model.OwnershipIndex(reservations) + for facts in observations: + expected = tuple( + reservation + for reservation in reservations + if _oracle_overlap(reservation.directory, facts) + ) + assert index.overlapping(facts) == expected + + +@pytest.mark.parametrize( + ( + "current_root", + "current_stage", + "root_key", + "build_id", + "target", + "retiring", + "expected", + ), + [ + ("root", None, "new", "build", "target", set(), "root-root"), + ("root", None, "old", "another-build", "target", set(), None), + ("stage", None, "old", "build", "target", set(), "root-staging"), + ("other", "root", "new", "build", "target", set(), "staging-root"), + ("other", "stage", "old", "build", "target", set(), None), + ("other", "stage", "new", "build", "target", {"old"}, None), + ( + "other", + "stage", + "new", + "another-build", + "target", + {"old"}, + "staging-staging", + ), + ( + "other", + "stage", + "new", + "build", + "another-target", + {"old"}, + "staging-staging", + ), + ("other", "stage", "new", "build", "target", set(), "staging-staging"), + ], +) +def test_index_preserves_ownership_and_retiring_staging_exceptions( + current_root: str, + current_stage: str | None, + root_key: str, + build_id: str, + target: str, + retiring: set[str], + expected: str | None, +) -> None: + facts = { + "root": _directory("/reserved-output", 2), + "stage": _directory("/stage", 3), + "other": _directory("/other", 4), + } + index = model.OwnershipIndex( + ( + model.Reservation("root", "old", "build", None, facts["root"]), + model.Reservation("staging", "old", "build", "target", facts["stage"]), + ) + ) + assert ( + index.conflict( + root=facts[current_root], + root_key=root_key, + build_id=build_id, + staging=() if current_stage is None else ((target, facts[current_stage]),), + retiring_root_keys=retiring, + ) + == expected + ) + + +def _plan(tmp_path: Path, name: str, root: Path | None = None) -> object: + return _write_plan( + tmp_path / f"{name}.plan", + root or tmp_path / name / "generated", + tmp_path / name / "build", + ((_target(name), "sample.protocyte.hpp"),), + ) + + +def test_reference_mode_never_loads_or_consults_the_preview( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + def unexpected() -> object: + pytest.fail("default validation loaded the experimental index") + + monkeypatch.setattr(coordinator, "_load_ownership_index", unexpected) + engine = coordinator.OutputCoordinator(tmp_path / "locks") + assert engine.reconcile(_plan(tmp_path, "current")) + assert engine.validation_metrics["mode"] == "reference" + assert engine.validation_metrics["authoritative"] == "reference" + + +def test_shadow_authenticates_all_records_in_both_phases_before_mutation( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="shadow" + ) + retained = [_plan(tmp_path, f"retained-{index}") for index in range(3)] + engine.reconcile_set((), retained) + expected = {engine._state_directory(plan.root) for plan in retained} + loaded: dict[str, list[Path]] = {"preview": [], "reference": []} + original_load = engine._load_recorded_plan + original_initialize = engine._initialize_claim_locked + + def load(state: Path, claim: object, **kwargs: object) -> object: + phase = "preview" if kwargs.get("_filesystem") is not None else "reference" + if state in expected: + loaded[phase].append(state) + return original_load(state, claim, **kwargs) + + def initialize(state: Path, plan: object) -> None: + assert engine.validation_metrics["reference_result"] == "accepted" + assert engine.validation_metrics["agreement"] is True + original_initialize(state, plan) + + monkeypatch.setattr(engine, "_load_recorded_plan", load) + monkeypatch.setattr(engine, "_initialize_claim_locked", initialize) + assert ( + len( + engine.reconcile_set( + (), [_plan(tmp_path, "first"), _plan(tmp_path, "second")] + ) + ) + == 2 + ) + assert sorted(loaded["preview"]) == sorted(expected) + assert sorted(loaded["reference"]) == sorted(expected) + assert engine.validation_metrics["preview_claims"] == 3 + assert engine.validation_metrics["indexed_reservations"] == 6 + assert engine.validation_metrics["index_queries"] == 4 + + +@pytest.mark.parametrize( + "replacement", ["file", "root-link", "staging-link", "ancestor-link"] +) +def test_foreign_changes_after_preview_are_rejected_before_new_claims( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, replacement: str +) -> None: + retained = _plan(tmp_path, "retained") + current = _plan(tmp_path, "current") + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="shadow" + ) + engine.reconcile(retained) + changed = False + + def inject(stage: str) -> None: + nonlocal changed + if stage != "after-index-preview" or changed: + return + changed = True + if replacement == "file": + retained.root.touch() + elif replacement == "ancestor-link": + retained.root.parent.rename(tmp_path / "moved-retained") + _directory_link(retained.root.parent, tmp_path) + else: + path = ( + retained.root + if replacement == "root-link" + else retained.targets[0].staging + ) + _directory_link(path, tmp_path) + + monkeypatch.setattr(engine, "_inject", inject) + with pytest.raises( + coordinator.CoordinatorError, match="symbolic link or junction|non-directory" + ): + engine.reconcile(current) + assert changed + assert engine.validation_metrics["preview_result"] == "accepted" + assert engine.validation_metrics["reference_result"] == "rejected" + assert engine.validation_metrics["agreement"] is False + assert len(list((engine.lock_root / "roots").glob("*/claim.json"))) == 1 + + +@pytest.mark.parametrize("preview", [False, RuntimeError("injected preview error")]) +def test_preview_false_positive_or_error_cannot_authorize_mutation( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, preview: object +) -> None: + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="shadow" + ) + + def sample(*args: object, **kwargs: object) -> bool: + if isinstance(preview, Exception): + raise preview + return bool(preview) + + monkeypatch.setattr(engine, "_preview_registry_index", sample) + with pytest.raises( + coordinator.CoordinatorError, match="disagrees with the fresh reference" + ): + engine.reconcile(_plan(tmp_path, "current")) + assert engine.validation_metrics["reference_result"] == "accepted" + assert not list((engine.lock_root / "roots").glob("*/claim.json")) + + +def test_preview_false_negative_never_bypasses_reference_rejection( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="shadow" + ) + retained = _plan(tmp_path, "retained") + engine.reconcile(retained) + monkeypatch.setattr(engine, "_preview_registry_index", lambda *args, **kwargs: True) + current = _plan(tmp_path, "current", retained.root / "nested") + with pytest.raises(coordinator.CoordinatorError, match="overlaps a root"): + engine.reconcile(current) + assert engine.validation_metrics["agreement"] is False + assert len(list((engine.lock_root / "roots").glob("*/claim.json"))) == 1 + + +def test_samples_expire_and_index_only_authorization_is_not_available( + tmp_path: Path, +) -> None: + sample = coordinator._SampledRegistryFilesystem(model) + sample.project(tmp_path) + sample.close() + for operation in (sample.project, sample.facts, sample.path_key): + with pytest.raises(coordinator.CoordinatorError, match="outside its preview"): + operation(tmp_path) + with pytest.raises(coordinator.CoordinatorError, match="outside its preview"): + sample.same_path(tmp_path, tmp_path) + with pytest.raises(coordinator.CoordinatorError, match="reference or shadow"): + coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="index-only" + ) + + +def test_read_only_preview_never_cleans_unclaimed_state_or_writes( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + engine = coordinator.OutputCoordinator(tmp_path / "locks") + retained = _plan(tmp_path, "retained") + engine.reconcile(retained) + abandoned = engine.lock_root / "roots" / ("a" * 64) + abandoned.mkdir() + (abandoned / "snapshot.json").write_text("{}\n") + current = _plan(tmp_path, "current") + + def mutation(*args: object, **kwargs: object) -> None: + pytest.fail("read-only preview attempted a filesystem mutation") + + for name in ("_atomic_write", "_durable_mkdir", "_durable_rmtree"): + monkeypatch.setattr(coordinator, name, mutation) + assert engine._preview_registry_index((current,), set()) + assert abandoned.exists() + assert engine.validation_metrics["preview_claims"] == 1 + assert engine.validation_metrics["preview_unclaimed_states"] == 1 + + +def test_foreign_physical_alias_introduced_after_preview_is_not_missed( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + retained = _plan(tmp_path, "retained") + current = _plan(tmp_path, "current") + retained.root.mkdir() + current.root.mkdir() + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="shadow" + ) + engine.reconcile(retained) + original_lstat = Path.lstat + + def alias_lstat(path: Path) -> object: + return original_lstat(current.root if path == retained.root else path) + + def inject(stage: str) -> None: + if stage == "after-index-preview": + monkeypatch.setattr(Path, "lstat", alias_lstat) + + monkeypatch.setattr(engine, "_inject", inject) + with pytest.raises(coordinator.CoordinatorError, match="overlaps a root"): + engine.reconcile(current) + assert engine.validation_metrics["preview_result"] == "accepted" + assert engine.validation_metrics["agreement"] is False + assert len(list((engine.lock_root / "roots").glob("*/claim.json"))) == 1 + + +@pytest.mark.parametrize("count", [16, 1024]) +def test_disjoint_index_query_does_not_compare_every_reservation( + monkeypatch: pytest.MonkeyPatch, count: int +) -> None: + calls = 0 + original = model.DirectoryObservation.overlaps + + def overlap(first: object, second: object) -> bool: + nonlocal calls + calls += 1 + return original(first, second) + + monkeypatch.setattr(model.DirectoryObservation, "overlaps", overlap) + index = model.OwnershipIndex( + model.Reservation( + "root", + str(number), + "build", + None, + _directory(f"/retained/{number}", number + 2), + ) + for number in range(count) + ) + assert not index.overlapping(_directory("/current/generated", count + 1000)) + assert calls == 0 + + +def test_optional_index_loader_does_not_write_bytecode_into_the_package_prefix( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + helper_source = Path(coordinator.__file__).with_name("ProtocyteOwnershipIndex.py") + (tmp_path / helper_source.name).write_bytes(helper_source.read_bytes()) + module_name = f"{coordinator.__name__}_ownership_index" + monkeypatch.setitem(sys.modules, module_name, sys.modules[module_name]) + monkeypatch.setattr( + coordinator, "__file__", str(tmp_path / "ProtocyteOutputCoordinator.py") + ) + monkeypatch.setattr(coordinator, "_ownership_module", None) + loaded = coordinator._load_ownership_index() + assert loaded.OwnershipIndex(()) + assert not (tmp_path / "__pycache__").exists() + + +def test_shadow_cli_preserves_the_claim_token_stdout_protocol( + tmp_path: Path, capsys: pytest.CaptureFixture[str] +) -> None: + _plan(tmp_path, "current") + result = coordinator.main( + [ + "reconcile", + "--lock-root", + str(tmp_path / "locks"), + "--plan", + str(tmp_path / "current.plan"), + "--experimental-registry-index", + ] + ) + captured = capsys.readouterr() + assert result == 0 + tokens = captured.out.splitlines() + assert len(tokens) == 1 and coordinator._is_sha256(tokens[0]) + assert all( + line.startswith("Protocyte output coordinator:") + for line in captured.err.splitlines() + ) From 41fec3d15bcae3909c3e239814c4a104e5a68ce1 Mon Sep 17 00:00:00 2001 From: Anthony Printup <92564080+anthonyprintup@users.noreply.github.com> Date: Mon, 16 Nov 2026 11:47:52 +0100 Subject: [PATCH 04/12] test(coordinator): repair symlink reset coverage and record upgrade review Create the output root before placing the unowned file symlink in the reset regression. Skip only recognized permission or unsupported-operation errors so missing-parent and other unexpected failures cannot masquerade as absent link support. Verify the external file remains intact after reset rejection. Document 33 isolated cross-version checks against issue #54's exact public protocol-v1 baseline: upgrade/rollback, no-op output and token preservation, publication/initialization/reset crash recovery, and shared registry locks in both process directions. Record the unchanged reference-validator and mutation implementations, plus host-specific coverage gaps and the unresolved fast-mode consistency proof. No production coordinator or benchmark source changed. Validation: cross-version cases 31 passed; mixed-version lock cases 2 passed; reset suites in reference and shadow modes each 14 passed, 2 skipped; Ruff and whitespace checks. The corrected file-symlink case now skips for the genuine Windows privilege restriction rather than a missing output directory. --- docs/experimental-index-results.md | 42 ++++++++++++++++++++++++++++++ tests/test_output_coordinator.py | 8 ++++++ 2 files changed, 50 insertions(+) diff --git a/docs/experimental-index-results.md b/docs/experimental-index-results.md index 4d24edf..d5dbfba 100644 --- a/docs/experimental-index-results.md +++ b/docs/experimental-index-results.md @@ -93,6 +93,48 @@ or slower layouts; it also misses the proposed 25-second research budget. These tests establish the safety of retaining reference authority. They do not prove that sampled topology remains valid or that index-only operation is safe. +## Upgrade and rollback review + +An additional isolated Windows/CPython 3.12 review used the exact public +[coordinator revision cited in issue #54](https://github.com/anthonyprintup/protocyte/blob/a37bde7156f444a22f7ab9d42392c91adb54ad30/cmake/ProtocyteOutputCoordinator.py). +Its source SHA-256 was verified as +`2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85`. +The experiment's coordinator/helper fingerprints remain unchanged from the +published measurements. + +All **33 additional cases passed**: + +| Case | Count | What was checked | +| --- | ---: | --- | +| Normal upgrade and rollback | 4 | Old/reference/shadow interchange, unchanged claim tokens, plan digests, no-op output bytes/mtimes and successful publication in both versions | +| Publication interrupted at four durable cuts | 12 | Recovery across versions from pending intent, either replaced output and committed snapshot, after deleting original staging payloads | +| Initialization interrupted at two cuts | 6 | Cross-version retry after initial snapshot or visible claim | +| Reset interrupted at three cuts | 9 | Cross-version completion using the existing token and durable reset intent | +| Two actual processes sharing a registry | 2 | Old holds/new waits and new holds/old waits; no claim appears before release, reconciliation completes afterward | + +The crash cases cover old-to-reference, old-to-shadow and shadow-to-old. The +steady-state cases additionally cover reference-to-old. These are tests against +that specific protocol-v1 baseline, not a guarantee for every historical release. +They used only fresh synthetic registries. + +AST comparison with preservation checkpoint `f804fd1` confirmed that the fresh +registry validator, file-lock implementation and twelve mutation/recovery/lock +methods retain their implementation. Protocol v1, plan header, registry namespace, +public CMake calls and generated C++ are unchanged by the experiment. A normal +upgrade should preserve existing build ownership without a state migration or +reset. Reconfigure through the normal build workflow to select the upgraded +package; relocating a build into another ownership identity remains subject to +the existing ownership checks. + +The review also repaired a test fixture: the unowned-file-symlink reset test had +not created its output directory, causing a missing-parent error to be reported +as unavailable symlink support. It now creates the directory, verifies the +external file survives, and only skips recognized permission/unsupported-operation +errors. On this host it still skips for the genuine Windows symlink privilege +restriction. Five other coordinator cases require case-sensitive paths or POSIX +path semantics. Those six cases remain coverage gaps for this host; supported-platform +CI and a suitable Windows symlink environment are still required before release. + ## Promotion gate The remaining problem is the filesystem-observation lifetime, described in diff --git a/tests/test_output_coordinator.py b/tests/test_output_coordinator.py index 385750f..fe6463a 100644 --- a/tests/test_output_coordinator.py +++ b/tests/test_output_coordinator.py @@ -1,5 +1,6 @@ from __future__ import annotations +import errno import hashlib import importlib.util import json @@ -2586,16 +2587,23 @@ def test_reset_rejects_an_unowned_generated_symlink(tmp_path: Path) -> None: token = engine.reconcile(plan) outside = tmp_path / "outside.hpp" outside.write_text("// outside\n", encoding="utf-8") + root.mkdir() unexpected = root / "stale.protocyte.hpp" try: unexpected.symlink_to(outside) except OSError as error: + if ( + error.errno not in (errno.EACCES, errno.EPERM, errno.ENOSYS, errno.ENOTSUP) + and getattr(error, "winerror", None) not in (1, 50, 1314) + ): + raise pytest.skip(f"file symlinks are unavailable: {error}") with pytest.raises(coordinator.CoordinatorError, match="unowned generated-looking"): engine.reset(plan, token) assert unexpected.is_symlink() + assert outside.read_text(encoding="utf-8") == "// outside\n" assert (lock_root / "roots" / _identity(root)).is_dir() From b17dfb78a41803716c33437c46becc0fd5d1090b Mon Sep 17 00:00:00 2001 From: Anthony Printup <92564080+anthonyprintup@users.noreply.github.com> Date: Mon, 16 Nov 2026 12:35:04 +0100 Subject: [PATCH 05/12] perf(coordinator): investigate fresh native path observation scopes Add a Windows path reader using fresh no-reparse native opens, bounded handle lifetimes and explicit syscall/resource counters. Recheck missing paths on every call and retain existing physical ancestry comparisons. Support only a private native-shadow mode that always runs reference validation before normal mutation; known unsupported capabilities fall back to reference and other disagreements fail closed. No authoritative index mode or automatic promotion is introduced. Install the optional helper beside the coordinator without prefix bytecode writes. Preserve protocol v1 and ownership keys, including reference fallback for explicit Windows namespace paths. Keep record paths fresh in the existing sampled preview. Fingerprint all three helpers in both benchmark tools. Add a real attribute-only directory-to-junction counterexample showing that read-sharing restrictions do not prove a topology lease. Cover fresh missing and existing paths, Unicode, reparse rejection, permission/status errors, scope expiry, handle cleanup, fallback and upgrade-token preservation. Record the bounded pilot failure: 9.197 and 11.421 seconds for the native phase at only 64 claims/11 plans, with reference phases still mandatory. Document the unproven operation-wide lifetime and failed timing gate; the index remains disabled. Validation: 1772 default tests passed, 41 skipped; native-shadow coordinator 87 passed, 6 skipped; CMake integration 18 passed, 1 skipped; final installed prefix checks 2 passed; minimum-Python observation/index checks 48 passed; 51 isolated public-baseline upgrade/rollback/recovery cases passed; Ruff and whitespace checks. No C++ or generated smoke files changed. --- CMakeLists.txt | 1 + cmake/ProtocyteOutputCoordinator.py | 177 ++++- cmake/ProtocytePathObservation.py | 245 +++++++ docs/experimental-index-contract.md | 8 + docs/experimental-index-results.md | 4 + docs/observation-mechanism-results.json | 830 ++++++++++++++++++++++++ docs/observation-mechanism-results.md | 140 ++++ docs/wiki/Contributing.md | 7 + tests/benchmark_output_registry.py | 11 +- tests/registry_validation_poc.py | 16 +- tests/test_output_coordinator_cmake.py | 8 +- tests/test_path_observation.py | 361 +++++++++++ 12 files changed, 1779 insertions(+), 29 deletions(-) create mode 100644 cmake/ProtocytePathObservation.py create mode 100644 docs/observation-mechanism-results.json create mode 100644 docs/observation-mechanism-results.md create mode 100644 tests/test_path_observation.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 2071b9f..17f16bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,6 +175,7 @@ if(PROTOCYTE_INSTALL) "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteGenerate.cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteOutputCoordinator.py" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteOwnershipIndex.py" + "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocytePathObservation.py" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteResetOutputDirectory.cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteFunctions.cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteProcess.cmake" diff --git a/cmake/ProtocyteOutputCoordinator.py b/cmake/ProtocyteOutputCoordinator.py index 1e64e0f..f7fedec 100644 --- a/cmake/ProtocyteOutputCoordinator.py +++ b/cmake/ProtocyteOutputCoordinator.py @@ -455,8 +455,9 @@ def visit(directory: Path) -> None: return paths -def _load_json(path: Path, description: str) -> dict[str, Any]: - expected = project_path(path, leaf_may_be_file=True) +def _load_json(path: Path, description: str, *, _filesystem: Any = None) -> dict[str, Any]: + project = project_path if _filesystem is None else _filesystem.project + expected = project(path, leaf_may_be_file=True) if expected != path or _is_link(path): _fail(f"{description} path is unsafe or was replaced: {path}") try: @@ -930,9 +931,13 @@ def close(self) -> None: self._projected.clear() self._facts.clear() - def project(self, path: Path) -> Path: + def project(self, path: Path, *, leaf_may_be_file: bool = False) -> Path: if self._closed: _fail("experimental filesystem sample used outside its preview") + if leaf_may_be_file: + # Registry record paths retain fresh, uncached observations even + # while the directory-only index preview samples geometry. + return project_path(path, leaf_may_be_file=True) name = os.fspath(_require_absolute(path, "sampled directory")) if name not in self._projected: projected = project_path(path) @@ -981,10 +986,79 @@ def same_path(self, first: Path, second: Path) -> bool: return not first_key[2] and not second_key[2] and first_key == second_key +_path_observation_module: Any = None + + +def _load_path_observation() -> Any: + global _path_observation_module + if _path_observation_module is None: + path = Path(__file__).with_name("ProtocytePathObservation.py") + name = f"{__name__}_path_observation" + spec = importlib.util.spec_from_file_location(name, path) + if spec is None or spec.loader is None: + _fail("experimental path observer could not be loaded") + module = importlib.util.module_from_spec(spec) + sys.modules[name] = module + try: + exec(compile(path.read_bytes(), os.fspath(path), "exec"), module.__dict__) + except BaseException: + sys.modules.pop(name, None) + raise + _path_observation_module = module + return _path_observation_module + + +class _FreshRegistryFilesystem: + """Fresh projection reader; retains no filesystem facts across comparisons. + + Native handles have call lifetime only. Physical containment, immutable + identity binding and the subsequent reference pass remain freshly observed. + """ + + def __init__(self) -> None: + self.module = _load_path_observation() + self.reader = self.module.FreshPathObserver() + + def close(self) -> None: + self.reader.close() + + def project(self, path: Path, *, leaf_may_be_file: bool = False) -> Path: + path = _require_absolute(path, "filesystem path") + try: + return self.reader.project(path, leaf_may_be_file=leaf_may_be_file) + except self.module.UnsafeObservation as error: + _fail(f"experimental path observation rejected a path: {error}") + + def path_key(self, path: Path) -> str: + identity = os.fspath(self.project(path)).replace("\\", "/").casefold() + return _sha256_bytes(identity.encode("utf-8")) + + def overlaps(self, first: Path, second: Path) -> bool: + first, second = self.project(first), self.project(second) + return ( + _projected_contains(first, second) + or _projected_contains(second, first) + or _projected_physically_contains(first, second) + or _projected_physically_contains(second, first) + ) + + def contains(self, parent: Path, child: Path) -> bool: + return _projected_contains( + self.project(parent), self.project(child, leaf_may_be_file=True) + ) + + def physically_contains(self, parent: Path, child: Path) -> bool: + return _projected_physically_contains(self.project(parent), self.project(child)) + + @staticmethod + def same_path(first: Path, second: Path) -> bool: + return _same_physical_path(first, second) + + class OutputCoordinator: def __init__(self, lock_root: Path, *, registry_validation: str = "reference") -> None: - if registry_validation not in ("reference", "shadow"): - _fail("registry validation must be reference or shadow") + if registry_validation not in ("reference", "shadow", "native-shadow"): + _fail("registry validation must be reference or shadow (including native-shadow)") self.lock_root = project_path(_require_absolute(lock_root, "output lock root")) self.registry_validation = registry_validation self.validation_metrics: dict[str, Any] = {} @@ -1407,6 +1481,41 @@ def _validate_registry( } self.validation_metrics = metrics preview_accepted: bool | None = None + if self.registry_validation == "native-shadow": + if progress is not None: + progress.phase("fresh experimental path observation", "validation") + started = time.perf_counter() + filesystem: Any = None + try: + filesystem = _FreshRegistryFilesystem() + self._validate_registry_reference( + plans, retiring_root_keys, _filesystem=filesystem + ) + preview_accepted = True + metrics["preview_result"] = "accepted" + except Exception as error: + module = _path_observation_module + if module is not None and isinstance(error, module.ObservationUnavailable): + # Capability failure is never a reason to demand privileges, + # change user configuration or authorize cached geometry. + metrics["preview_result"] = "unavailable" + else: + metrics["preview_result"] = "sample-error" + metrics["preview_error_type"] = type(error).__name__ + finally: + if filesystem is not None: + try: + filesystem.close() + except Exception as error: + preview_accepted = None + metrics["preview_result"] = "sample-error" + metrics["preview_error_type"] = type(error).__name__ + finally: + metrics.update(filesystem.reader.metrics()) + metrics["preview_wall_seconds"] = time.perf_counter() - started + self._inject("after-native-observation") + if progress is not None: + progress.phase("validating registry (reference authority)", "validation") if self.registry_validation == "shadow": if progress is not None: progress.phase("sampling experimental ownership index", "validation") @@ -1439,7 +1548,11 @@ def _validate_registry( finally: metrics["reference_wall_seconds"] = time.perf_counter() - started metrics["reference_result"] = "accepted" - if self.registry_validation == "shadow": + if self.registry_validation in ("shadow", "native-shadow"): + if metrics.get("preview_result") == "unavailable": + metrics["agreement"] = None + metrics["fallback"] = "reference" + return metrics["agreement"] = preview_accepted is True if preview_accepted is not True: _fail( @@ -1555,11 +1668,19 @@ def _validate_registry_reference( retiring_root_keys: set[str] | None = None, *, progress: _ReconcileProgress | None = None, + _filesystem: Any = None, ) -> None: if not plans: return if retiring_root_keys is None: retiring_root_keys = set() + project = project_path if _filesystem is None else _filesystem.project + path_key = _path_key if _filesystem is None else _filesystem.path_key + overlaps = _paths_overlap if _filesystem is None else _filesystem.overlaps + contains = _contains if _filesystem is None else _filesystem.contains + physically_contains = _physically_contains if _filesystem is None else _filesystem.physically_contains + if _filesystem is not None: + self.validation_metrics["native_claims_checked"] = 0 internal_paths = ( self.lock_root / "roots", self.lock_root / "generation", @@ -1567,15 +1688,15 @@ def _validate_registry_reference( ) for plan in plans: for target in plan.targets: - if _contains(target.staging, self.lock_root) or _physically_contains( + if contains(target.staging, self.lock_root) or physically_contains( target.staging, self.lock_root ): _fail( "generation staging contains the output coordinator lock root: " f"{target.staging} and {self.lock_root}" ) - if _paths_overlap(plan.root, self.lock_root) or any( - _paths_overlap(path, plan.root) for path in internal_paths + if overlaps(plan.root, self.lock_root) or any( + overlaps(path, plan.root) for path in internal_paths ): _fail( "output root overlaps the output coordinator lock namespace: " @@ -1586,7 +1707,7 @@ def _validate_registry_reference( if progress is not None: progress.registry(states=0) return - if project_path(roots) != roots: + if project(roots) != roots: _fail(f"output registry is unsafe or was replaced: {roots}") try: with os.scandir(roots) as stream: @@ -1610,34 +1731,40 @@ def _validate_registry_reference( _fail(f"could not enumerate output claim state {state}: {error}") claim_path = state / "claim.json" if "claim.json" not in names: - _durable_rmtree(state) + if _filesystem is None: + _durable_rmtree(state) continue - claim = _load_json(claim_path, "output claim") + claim = _load_json(claim_path, "output claim", _filesystem=_filesystem) self._validate_claim_shape(claim, claim_path) - claimed_root, _ = self._claim_paths(claim, claim_path) + claimed_root, _ = self._claim_paths(claim, claim_path, _filesystem=_filesystem) if entry.name != claim["root_key"]: _fail( f"output claim is stored under the wrong registry key: {claim_path}" ) - recorded_plan = self._load_recorded_plan(state, claim) + if _filesystem is None: + recorded_plan = self._load_recorded_plan(state, claim) + else: + recorded_plan = self._load_recorded_plan(state, claim, _filesystem=_filesystem) if progress is not None: progress.registry(claim=True) + if _filesystem is not None: + self.validation_metrics["native_claims_checked"] += 1 recorded_targets = recorded_plan.targets if recorded_plan else () for plan in plans: - same_root_key = claim["root_key"] == _path_key(plan.root) - if _paths_overlap(claimed_root, plan.root) and not same_root_key: + same_root_key = claim["root_key"] == path_key(plan.root) + if overlaps(claimed_root, plan.root) and not same_root_key: _fail( "output root overlaps a root claimed by another build: " f"{plan.root} and {claimed_root}" ) for recorded_target in recorded_targets: - if _paths_overlap(recorded_target.staging, plan.root): + if overlaps(recorded_target.staging, plan.root): _fail( "output root overlaps staging reserved by another plan: " f"{plan.root} and {recorded_target.staging}" ) for target in plan.targets: - if _paths_overlap(claimed_root, target.staging): + if overlaps(claimed_root, target.staging): _fail( "generation staging overlaps a claimed output root: " f"{target.staging} and {claimed_root}" @@ -1654,7 +1781,7 @@ def _validate_registry_reference( and target.identity == recorded_target.identity ): continue - if _paths_overlap(recorded_target.staging, target.staging): + if overlaps(recorded_target.staging, target.staging): _fail( "generation staging overlaps staging reserved by another plan: " f"{target.staging} and {recorded_target.staging}" @@ -1785,7 +1912,7 @@ def _load_recorded_plan( if not path.exists(): return None plan = Plan.from_payload( - _load_json(path, "configured output plan"), path, _filesystem=_filesystem + _load_json(path, "configured output plan", _filesystem=_filesystem), path, _filesystem=_filesystem ) self._require_plan_claim_binding(plan, claim, path, _filesystem=_filesystem) return plan @@ -2348,6 +2475,9 @@ def _parse_arguments(arguments: Sequence[str]) -> argparse.Namespace: parser.add_argument( "--experimental-registry-index", action="store_true", help=argparse.SUPPRESS ) + parser.add_argument( + "--experimental-native-observation", action="store_true", help=argparse.SUPPRESS + ) return parser.parse_args(arguments) @@ -2362,9 +2492,14 @@ def main(arguments: Sequence[str] | None = None) -> int: return 0 if options.lock_root is None: _fail(f"{options.command} requires --lock-root") + if options.experimental_native_observation and options.experimental_registry_index: + _fail("choose one experimental validation mode") coordinator = OutputCoordinator( options.lock_root, - registry_validation="shadow" if options.experimental_registry_index else "reference", + registry_validation=( + "native-shadow" if options.experimental_native_observation + else "shadow" if options.experimental_registry_index else "reference" + ), ) if options.command == "reconcile-set": current = [Plan.read(path) for path in options.current_plan] diff --git a/cmake/ProtocytePathObservation.py b/cmake/ProtocytePathObservation.py new file mode 100644 index 0000000..6da3476 --- /dev/null +++ b/cmake/ProtocytePathObservation.py @@ -0,0 +1,245 @@ +"""Experimental fresh Windows path observations, never an operation-wide lease. + +Each projection opens the entire existing path with OBJ_DONT_REPARSE, reads that +handle and closes it before returning. No filesystem facts are cached. Missing +components are searched again on every call. This module grants no ownership or +mutation authority; the coordinator uses it only behind reference verification. +""" + +from __future__ import annotations + +import ctypes +import os +from pathlib import Path + + +class ObservationUnavailable(RuntimeError): + """The native observation contract is unavailable; use the reference path.""" + + +class UnsafeObservation(RuntimeError): + """An observed path is unsafe or changed during observation.""" + + +class FreshPathObserver: + """Own native call bindings, not observations, for one validation phase.""" + + def __init__(self) -> None: + if os.name != "nt": + raise ObservationUnavailable("native path observation requires Windows") + from ctypes import wintypes as w + + class UnicodeString(ctypes.Structure): + _fields_ = [ + ("Length", w.USHORT), + ("MaximumLength", w.USHORT), + ("Buffer", w.LPWSTR), + ] + + class ObjectAttributes(ctypes.Structure): + _fields_ = [ + ("Length", w.ULONG), + ("RootDirectory", w.HANDLE), + ("ObjectName", ctypes.POINTER(UnicodeString)), + ("Attributes", w.ULONG), + ("SecurityDescriptor", w.LPVOID), + ("SecurityQualityOfService", w.LPVOID), + ] + + class IoStatusBlock(ctypes.Structure): + _fields_ = [("Status", ctypes.c_void_p), ("Information", ctypes.c_size_t)] + + class AttributeTagInfo(ctypes.Structure): + _fields_ = [("Attributes", w.DWORD), ("ReparseTag", w.DWORD)] + + self._w = w + self._unicode = UnicodeString + self._attributes = ObjectAttributes + self._status = IoStatusBlock + self._tag = AttributeTagInfo + self._nt = ctypes.WinDLL("ntdll", use_last_error=True) + self._kernel = ctypes.WinDLL("kernel32", use_last_error=True) + self._open = self._nt.NtCreateFile + self._open.argtypes = ( + ctypes.POINTER(w.HANDLE), + w.DWORD, + ctypes.POINTER(ObjectAttributes), + ctypes.POINTER(IoStatusBlock), + w.LPVOID, + w.ULONG, + w.ULONG, + w.ULONG, + w.ULONG, + w.LPVOID, + w.ULONG, + ) + self._open.restype = w.LONG + self._dos_error = self._nt.RtlNtStatusToDosError + self._dos_error.argtypes = (w.LONG,) + self._dos_error.restype = w.ULONG + self._info = self._kernel.GetFileInformationByHandleEx + self._info.argtypes = (w.HANDLE, ctypes.c_int, w.LPVOID, w.DWORD) + self._info.restype = w.BOOL + self._final = self._kernel.GetFinalPathNameByHandleW + self._final.argtypes = (w.HANDLE, w.LPWSTR, w.DWORD, w.DWORD) + self._final.restype = w.DWORD + self._close = self._kernel.CloseHandle + self._close.argtypes = (w.HANDLE,) + self._close.restype = w.BOOL + self._closed = False + self.projections = 0 + self.open_calls = 0 + self.information_calls = 0 + self.final_path_calls = 0 + self.handles_opened = 0 + self.handles_closed = 0 + + def close(self) -> None: + self._closed = True + if self.handles_opened != self.handles_closed: + raise UnsafeObservation("native observation leaked a handle") + + @staticmethod + def _native_name(path: Path) -> str: + text = os.fspath(path) + if text.startswith("\\\\?\\"): + # Path.resolve preserves an explicitly supplied namespace prefix. + # Stripping it would alter the existing ownership-key spelling. + raise ObservationUnavailable("explicit namespaces use reference validation") + # Deliberately narrow capability boundary. Device names, UNC shares and + # alternate data streams use reference validation, without new user flags. + if ( + not path.is_absolute() + or len(text) < 3 + or not text[0].isascii() + or not text[0].isalpha() + or text[1:3] != ":\\" + or ":" in text[2:] + or any(character in text for character in ("\x00", "\r", "\n")) + ): + raise ObservationUnavailable("path needs the portable reference reader") + return "\\??\\" + text + + def _open_existing(self, path: Path): + text = self._native_name(path) + encoded_length = len(text.encode("utf-16-le")) + if encoded_length > 65532: + raise ObservationUnavailable("path exceeds the native Unicode name limit") + storage = ctypes.create_unicode_buffer(text) + name = self._unicode( + encoded_length, + encoded_length + 2, + ctypes.cast(storage, self._w.LPWSTR), + ) + attributes = self._attributes( + ctypes.sizeof(self._attributes), + None, + ctypes.pointer(name), + 0x1040, # OBJ_DONT_REPARSE | OBJ_CASE_INSENSITIVE + None, + None, + ) + status = self._status() + handle = self._w.HANDLE() + self.open_calls += 1 + result = self._open( + ctypes.byref(handle), + 0x100080, # SYNCHRONIZE | FILE_READ_ATTRIBUTES + ctypes.byref(attributes), + ctypes.byref(status), + None, + 0, + 7, # share read/write/delete; no claim of a topology freeze + 1, # FILE_OPEN, never create anything + 0x20, # FILE_SYNCHRONOUS_IO_NONALERT; no incompatible DIRECTORY flags + None, + 0, + ) + code = result & 0xFFFFFFFF + if code in (0xC0000034, 0xC000003A): # name/path not found + return None + if code in (0xC000050B, 0xC0000279, 0xC0000280): + raise UnsafeObservation("filesystem path contains a reparse point") + if result < 0: + # Do not reinterpret permission/sharing/invalid-name failures as + # missing components. The caller can only fall back to reference. + raise ctypes.WinError(self._dos_error(result)) + if not handle.value: + raise UnsafeObservation("native open returned an unsupported result") + self.handles_opened += 1 + if code != 0: + if not self._close(handle): + raise ctypes.WinError(ctypes.get_last_error()) + self.handles_closed += 1 + raise UnsafeObservation("native open returned an unsupported result") + return handle + + def _describe(self, handle, *, leaf_may_be_file: bool) -> Path: + tag = self._tag() + self.information_calls += 1 + if not self._info(handle, 9, ctypes.byref(tag), ctypes.sizeof(tag)): + raise ctypes.WinError(ctypes.get_last_error()) + if tag.Attributes & 0x400: # FILE_ATTRIBUTE_REPARSE_POINT, any tag + raise UnsafeObservation("filesystem path contains a reparse point") + if not tag.Attributes & 0x10 and not leaf_may_be_file: + raise UnsafeObservation("filesystem path has a non-directory ancestor") + capacity = 512 + for _ in range(3): + buffer = ctypes.create_unicode_buffer(capacity) + self.final_path_calls += 1 + size = self._final(handle, buffer, capacity, 0) + if not size: + raise ctypes.WinError(ctypes.get_last_error()) + if size < capacity: + value = buffer.value + if not value.startswith("\\\\?\\") or value.startswith("\\\\?\\UNC\\"): + raise ObservationUnavailable("unsupported final path namespace") + return Path(os.path.normpath(value[4:])) + capacity = size + 1 + raise UnsafeObservation("native final path changed repeatedly") + + def project(self, path: Path, *, leaf_may_be_file: bool = False) -> Path: + if self._closed: + raise UnsafeObservation("filesystem observation used outside its scope") + self.projections += 1 + path = Path(os.path.normpath(path)) + self._native_name(path) + # Fresh on every call. In particular, there is no negative lookup cache + # and no retained ancestor handle that could lose its name binding. + for _ in range(8): + current = path + missing: list[str] = [] + while True: + handle = self._open_existing(current) + if handle is not None: + break + if current.parent == current: + raise UnsafeObservation("could not observe an existing ancestor") + missing.append(current.name) + current = current.parent + try: + projected = self._describe( + handle, leaf_may_be_file=leaf_may_be_file and not missing + ) + except FileNotFoundError: + continue + finally: + if not self._close(handle): + raise ctypes.WinError(ctypes.get_last_error()) + self.handles_closed += 1 + for component in reversed(missing): + if component in ("", ".", ".."): + raise UnsafeObservation("unsafe missing path component") + projected /= component + return projected + raise UnsafeObservation("filesystem path changed repeatedly while observing") + + def metrics(self) -> dict[str, int]: + return { + "native_projections": self.projections, + "native_open_calls": self.open_calls, + "native_information_calls": self.information_calls, + "native_final_path_calls": self.final_path_calls, + "native_handles_opened": self.handles_opened, + "native_handles_closed": self.handles_closed, + } diff --git a/docs/experimental-index-contract.md b/docs/experimental-index-contract.md index 48dcff8..571ff6b 100644 --- a/docs/experimental-index-contract.md +++ b/docs/experimental-index-contract.md @@ -68,3 +68,11 @@ The first milestone is a reviewable experimental index with differential and adversarial evidence. Promotion to authoritative indexed validation, packaging refactoring and the public generation CLI remain gated on the filesystem-lifetime proof. Correctness takes precedence over meeting a timing threshold. + +## Follow-up observation experiment + +The [fresh observation experiment](observation-mechanism-results.md) adds a +private `native-shadow` mode. It retains reference authority and adds no indexed +authorization mode. A real attribute-only reparse conversion disproved ordinary +read-handle pinning as a path-lifetime proof. The fresh reader's pilot also failed +the performance gate. The original cached-index promotion boundary remains closed. diff --git a/docs/experimental-index-results.md b/docs/experimental-index-results.md index d5dbfba..8f3a820 100644 --- a/docs/experimental-index-results.md +++ b/docs/experimental-index-results.md @@ -1,5 +1,9 @@ # Ownership-index experiment +Subsequent work: [fresh observation experiment and handle-lease counterexample](observation-mechanism-results.md). +The measurements below retain their original implementation fingerprints; they +have not been relabeled as current-source performance or authoritative validation. + The experiment is on `codex/experimental-generation-engine`, directly above preservation commit `f804fd1` on `codex/issue-54-registry-scaling`. The preceding work was committed before branching; no remote publication or consumer-registry diff --git a/docs/observation-mechanism-results.json b/docs/observation-mechanism-results.json new file mode 100644 index 0000000..c2835a8 --- /dev/null +++ b/docs/observation-mechanism-results.json @@ -0,0 +1,830 @@ +{ + "status": "operation-wide observation proof and timing gate FAILED; index stays non-authoritative", + "normal_validation": "reference", + "index_authorization_enabled": false, + "current_implementation_files": { + "ProtocyteOutputCoordinator.py": "8701f91a82a033aed9cfdb1909bcc135ecd695d56c84271e1f382e76c2b1348b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4" + }, + "notes": [ + "All registries are fresh explicit synthetic fixtures; no consumer/shared registry accessed.", + "Native and reference registry phases, current-plan validation, setup, locks and reconciliation remain distinct.", + "Native API counters supplement profiled Python filesystem calls; they are not counted as eliminated observations.", + "All reported performance samples include full reference verification; none is an index-only speedup.", + "The current source restricts explicit extended namespace paths to reference fallback after the second measured snapshot; measured fingerprints are retained unchanged.", + "No 2172-claim native scaling sample was run because the bounded pilot failed the research cost gate.", + "Timing variation, instrumentation and uncontrolled workstation/cache effects prevent a reliable under-30-second claim." + ], + "native_counterexample": { + "real_attribute_only_directory_to_junction_conversion_while_read_handle_open": true, + "fresh_observer_rejected_conversion": true, + "operation_wide_read_handle_lease_disproved": true + }, + "journal_probe": { + "fresh_test_directory_close_record_supported": true, + "zero_access_volume_query_supported": false, + "volume_query_win32_error": 1, + "journal_created_or_configured": false, + "journal_authority_implemented": false + }, + "verification": { + "full_default": { + "passed": 1772, + "skipped": 41 + }, + "native_shadow_coordinator": { + "passed": 87, + "skipped": 6 + }, + "cmake_integration": { + "passed": 18, + "skipped": 1 + }, + "native_observation_tests": 22, + "minimum_python_observation_and_index": { + "passed": 48 + }, + "explicit_namespace_upgrade_preserved_claim": true, + "cross_version_upgrade_and_recovery": 51, + "minimum_python": "3.12.9" + }, + "measurements": { + "pilot": { + "platform": "Windows", + "python": "3.12.9", + "timings_include_instrumentation": true, + "setup_method": "private locked initialization/reconciliation (issue #54 POC)", + "coordinator_sha256": { + "candidate": "8701f91a82a033aed9cfdb1909bcc135ecd695d56c84271e1f382e76c2b1348b" + }, + "implementation_files": { + "candidate": { + "ProtocyteOutputCoordinator.py": "8701f91a82a033aed9cfdb1909bcc135ecd695d56c84271e1f382e76c2b1348b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "b7de52b7cf5f823bf6491ccd9cdf89f732ebc87655dd8116a5bf0fbf99789bf0" + } + }, + "samples": [ + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 8, + "current_plans": 1, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "seed_wall_seconds": 1.3629234000109136, + "seed_cpu_seconds": 0.734375, + "validation_wall_seconds": 0.6381476999958977, + "validation_cpu_seconds": 0.484375, + "reconcile_wall_seconds": 0.9638928000349551, + "reconcile_cpu_seconds": 0.59375, + "lock_wait_wall_seconds": 0.03132269997149706, + "registry_lock_held_wall_seconds": 0.9450623000157066, + "current_plan_validation_wall_seconds": 3.1999661587178707e-06, + "validation_engine": "native-shadow", + "index_experiment": { + "mode": "native-shadow", + "authoritative": "reference", + "preview_wall_seconds": 0.19492140004877, + "reference_wall_seconds": 0.44041520002065226, + "agreement": true, + "native_claims_checked": 8, + "preview_result": "accepted", + "native_projections": 229, + "native_open_calls": 387, + "native_information_calls": 229, + "native_final_path_calls": 229, + "native_handles_opened": 229, + "native_handles_closed": 229, + "reference_result": "accepted" + }, + "shadow_candidate_wall_seconds": 0.19492140004877, + "reference_validation_wall_seconds": 0.44041520002065226, + "registry_validations": 1, + "registry_scans": 2, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 229, + "path_projections_total": 293, + "validation_filesystem_calls": { + "nt.stat": 5395, + "nt.lstat": 389, + "nt._getfinalpathname": 458 + }, + "completed_plans": 1 + }, + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 8, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "seed_wall_seconds": 1.3515385999926366, + "seed_cpu_seconds": 0.796875, + "validation_wall_seconds": 5.00293870002497, + "validation_cpu_seconds": 3.765625, + "reconcile_wall_seconds": 8.449291899974924, + "reconcile_cpu_seconds": 5.75, + "lock_wait_wall_seconds": 0.45186049985932186, + "registry_lock_held_wall_seconds": 8.407875600038096, + "current_plan_validation_wall_seconds": 1.6476713999873027, + "validation_engine": "native-shadow", + "index_experiment": { + "mode": "native-shadow", + "authoritative": "reference", + "preview_wall_seconds": 1.8662118999636732, + "reference_wall_seconds": 3.136588800000027, + "agreement": true, + "native_claims_checked": 8, + "preview_result": "accepted", + "native_projections": 1069, + "native_open_calls": 2007, + "native_information_calls": 1069, + "native_final_path_calls": 1069, + "native_handles_opened": 1069, + "native_handles_closed": 1069, + "reference_result": "accepted" + }, + "shadow_candidate_wall_seconds": 1.8662118999636732, + "reference_validation_wall_seconds": 3.136588800000027, + "registry_validations": 1, + "registry_scans": 2, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 1069, + "path_projections_total": 2103, + "validation_filesystem_calls": { + "nt.stat": 35822, + "nt.lstat": 2009, + "nt._getfinalpathname": 2138 + }, + "completed_plans": 11 + }, + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 64, + "current_plans": 1, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "seed_wall_seconds": 10.497204200015403, + "seed_cpu_seconds": 5.765625, + "validation_wall_seconds": 5.7248135000118054, + "validation_cpu_seconds": 4.359375, + "reconcile_wall_seconds": 5.898639599967282, + "reconcile_cpu_seconds": 4.46875, + "lock_wait_wall_seconds": 0.041007000021636486, + "registry_lock_held_wall_seconds": 5.870908299984876, + "current_plan_validation_wall_seconds": 4.599976819008589e-06, + "validation_engine": "native-shadow", + "index_experiment": { + "mode": "native-shadow", + "authoritative": "reference", + "preview_wall_seconds": 2.0492028000298887, + "reference_wall_seconds": 3.675467099994421, + "agreement": true, + "native_claims_checked": 64, + "preview_result": "accepted", + "native_projections": 1741, + "native_open_calls": 2963, + "native_information_calls": 1741, + "native_final_path_calls": 1741, + "native_handles_opened": 1741, + "native_handles_closed": 1741, + "reference_result": "accepted" + }, + "shadow_candidate_wall_seconds": 2.0492028000298887, + "reference_validation_wall_seconds": 3.675467099994421, + "registry_validations": 1, + "registry_scans": 2, + "recorded_plan_loads_in_validation": 128, + "path_projections_in_validation": 1741, + "path_projections_total": 1805, + "validation_filesystem_calls": { + "nt.stat": 40336, + "nt.lstat": 2965, + "nt._getfinalpathname": 3482 + }, + "completed_plans": 1 + }, + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 64, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "seed_wall_seconds": 8.916910199972335, + "seed_cpu_seconds": 4.921875, + "validation_wall_seconds": 27.40504320000764, + "validation_cpu_seconds": 22.453125, + "reconcile_wall_seconds": 29.590691499994136, + "reconcile_cpu_seconds": 23.875, + "lock_wait_wall_seconds": 0.26843130006454885, + "registry_lock_held_wall_seconds": 29.563866099982988, + "current_plan_validation_wall_seconds": 0.8520258999778889, + "validation_engine": "native-shadow", + "index_experiment": { + "mode": "native-shadow", + "authoritative": "reference", + "preview_wall_seconds": 9.197408800013363, + "reference_wall_seconds": 18.207503099984024, + "agreement": true, + "native_claims_checked": 64, + "preview_result": "accepted", + "native_projections": 7621, + "native_open_calls": 14663, + "native_information_calls": 7621, + "native_final_path_calls": 7621, + "native_handles_opened": 7621, + "native_handles_closed": 7621, + "reference_result": "accepted" + }, + "shadow_candidate_wall_seconds": 9.197408800013363, + "reference_validation_wall_seconds": 18.207503099984024, + "registry_validations": 1, + "registry_scans": 2, + "recorded_plan_loads_in_validation": 128, + "path_projections_in_validation": 7621, + "path_projections_total": 8655, + "validation_filesystem_calls": { + "nt.stat": 256686, + "nt.lstat": 14665, + "nt._getfinalpathname": 15242 + }, + "completed_plans": 11 + } + ], + "medians": [ + { + "retained_claims": 8, + "current_plans": 1, + "candidate": { + "seed_wall_seconds": 1.3629234000109136, + "seed_cpu_seconds": 0.734375, + "validation_wall_seconds": 0.6381476999958977, + "validation_cpu_seconds": 0.484375, + "reconcile_wall_seconds": 0.9638928000349551, + "reconcile_cpu_seconds": 0.59375, + "lock_wait_wall_seconds": 0.03132269997149706, + "registry_lock_held_wall_seconds": 0.9450623000157066, + "current_plan_validation_wall_seconds": 3.1999661587178707e-06, + "shadow_candidate_wall_seconds": 0.19492140004877, + "reference_validation_wall_seconds": 0.44041520002065226, + "registry_validations": 1, + "registry_scans": 2, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 229, + "path_projections_total": 293 + } + }, + { + "retained_claims": 8, + "current_plans": 11, + "candidate": { + "seed_wall_seconds": 1.3515385999926366, + "seed_cpu_seconds": 0.796875, + "validation_wall_seconds": 5.00293870002497, + "validation_cpu_seconds": 3.765625, + "reconcile_wall_seconds": 8.449291899974924, + "reconcile_cpu_seconds": 5.75, + "lock_wait_wall_seconds": 0.45186049985932186, + "registry_lock_held_wall_seconds": 8.407875600038096, + "current_plan_validation_wall_seconds": 1.6476713999873027, + "shadow_candidate_wall_seconds": 1.8662118999636732, + "reference_validation_wall_seconds": 3.136588800000027, + "registry_validations": 1, + "registry_scans": 2, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 1069, + "path_projections_total": 2103 + } + }, + { + "retained_claims": 64, + "current_plans": 1, + "candidate": { + "seed_wall_seconds": 10.497204200015403, + "seed_cpu_seconds": 5.765625, + "validation_wall_seconds": 5.7248135000118054, + "validation_cpu_seconds": 4.359375, + "reconcile_wall_seconds": 5.898639599967282, + "reconcile_cpu_seconds": 4.46875, + "lock_wait_wall_seconds": 0.041007000021636486, + "registry_lock_held_wall_seconds": 5.870908299984876, + "current_plan_validation_wall_seconds": 4.599976819008589e-06, + "shadow_candidate_wall_seconds": 2.0492028000298887, + "reference_validation_wall_seconds": 3.675467099994421, + "registry_validations": 1, + "registry_scans": 2, + "recorded_plan_loads_in_validation": 128, + "path_projections_in_validation": 1741, + "path_projections_total": 1805 + } + }, + { + "retained_claims": 64, + "current_plans": 11, + "candidate": { + "seed_wall_seconds": 8.916910199972335, + "seed_cpu_seconds": 4.921875, + "validation_wall_seconds": 27.40504320000764, + "validation_cpu_seconds": 22.453125, + "reconcile_wall_seconds": 29.590691499994136, + "reconcile_cpu_seconds": 23.875, + "lock_wait_wall_seconds": 0.26843130006454885, + "registry_lock_held_wall_seconds": 29.563866099982988, + "current_plan_validation_wall_seconds": 0.8520258999778889, + "shadow_candidate_wall_seconds": 9.197408800013363, + "reference_validation_wall_seconds": 18.207503099984024, + "registry_validations": 1, + "registry_scans": 2, + "recorded_plan_loads_in_validation": 128, + "path_projections_in_validation": 7621, + "path_projections_total": 8655 + } + } + ] + }, + "second_sample": { + "platform": "Windows", + "python": "3.12.9", + "timings_include_instrumentation": true, + "setup_method": "private locked initialization/reconciliation (issue #54 POC)", + "coordinator_sha256": { + "candidate": "8701f91a82a033aed9cfdb1909bcc135ecd695d56c84271e1f382e76c2b1348b" + }, + "implementation_files": { + "candidate": { + "ProtocyteOutputCoordinator.py": "8701f91a82a033aed9cfdb1909bcc135ecd695d56c84271e1f382e76c2b1348b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "7225328f1059846be1508ceef675216ad942f7cc1b651a87080a0ff5ca7f0a5f" + } + }, + "samples": [ + { + "revision": "candidate", + "repetition": 0, + "retained_claims": 64, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "seed_wall_seconds": 12.453965900000185, + "seed_cpu_seconds": 6.078125, + "validation_wall_seconds": 31.676921500009485, + "validation_cpu_seconds": 25.453125, + "reconcile_wall_seconds": 35.244973800028674, + "reconcile_cpu_seconds": 27.625, + "lock_wait_wall_seconds": 0.5206469999393448, + "registry_lock_held_wall_seconds": 35.15774579998106, + "current_plan_validation_wall_seconds": 1.5557207999518141, + "validation_engine": "native-shadow", + "index_experiment": { + "mode": "native-shadow", + "authoritative": "reference", + "preview_wall_seconds": 11.420584300009068, + "reference_wall_seconds": 20.253657999972347, + "agreement": true, + "native_claims_checked": 64, + "preview_result": "accepted", + "native_projections": 7621, + "native_open_calls": 14663, + "native_information_calls": 7621, + "native_final_path_calls": 7621, + "native_handles_opened": 7621, + "native_handles_closed": 7621, + "reference_result": "accepted" + }, + "shadow_candidate_wall_seconds": 11.420584300009068, + "reference_validation_wall_seconds": 20.253657999972347, + "registry_validations": 1, + "registry_scans": 2, + "recorded_plan_loads_in_validation": 128, + "path_projections_in_validation": 7621, + "path_projections_total": 8655, + "validation_filesystem_calls": { + "nt.stat": 256689, + "nt.lstat": 14665, + "nt._getfinalpathname": 15242 + }, + "completed_plans": 11 + } + ], + "medians": [ + { + "retained_claims": 64, + "current_plans": 11, + "candidate": { + "seed_wall_seconds": 12.453965900000185, + "seed_cpu_seconds": 6.078125, + "validation_wall_seconds": 31.676921500009485, + "validation_cpu_seconds": 25.453125, + "reconcile_wall_seconds": 35.244973800028674, + "reconcile_cpu_seconds": 27.625, + "lock_wait_wall_seconds": 0.5206469999393448, + "registry_lock_held_wall_seconds": 35.15774579998106, + "current_plan_validation_wall_seconds": 1.5557207999518141, + "shadow_candidate_wall_seconds": 11.420584300009068, + "reference_validation_wall_seconds": 20.253657999972347, + "registry_validations": 1, + "registry_scans": 2, + "recorded_plan_loads_in_validation": 128, + "path_projections_in_validation": 7621, + "path_projections_total": 8655 + } + } + ] + } + }, + "upgrade_review": { + "scope": "isolated Windows cross-version checks; no consumer registry accessed", + "legacy_public_revision": "a37bde7156f444a22f7ab9d42392c91adb54ad30", + "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", + "candidate_coordinator_sha256": "8701f91a82a033aed9cfdb1909bcc135ecd695d56c84271e1f382e76c2b1348b", + "unchanged_ast_methods_since_checkpoint": [ + "reconcile_set", + "_reconcile_locked", + "validate", + "publish", + "reset", + "_recover", + "_apply_pending", + "_publish_one", + "_initialize_claim_locked", + "_release_claim", + "_generation_lock", + "_publication_lock" + ], + "reference_validator_ast_unchanged_since_checkpoint": false, + "file_lock_ast_unchanged_since_checkpoint": true, + "passed_cases": 51, + "cases": [ + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "reference", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "reference", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "shadow", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "native-shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "native-shadow", + "reader": "old", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + } + ] + } +} diff --git a/docs/observation-mechanism-results.md b/docs/observation-mechanism-results.md new file mode 100644 index 0000000..96e1eb4 --- /dev/null +++ b/docs/observation-mechanism-results.md @@ -0,0 +1,140 @@ +# Fresh observation experiment and rejected handle lease + +The operation-wide observation proof and the under-30-second gate **have not +passed**. The index remains non-authoritative and disabled in normal use. This +experiment adds a bounded, fresh native path reader and tests a proposed handle +lease; it does not claim a safe cached-index replacement for the reference pass. + +## What was implemented + +`ProtocytePathObservation.py` provides an experimental Windows reader. Each call +opens an existing path with `NtCreateFile`, `FILE_OPEN` and `OBJ_DONT_REPARSE`, +checks the opened object's attributes, obtains its normalized path and closes +the handle before returning. Missing components are searched again on every +call. There is no filesystem-fact or negative-lookup cache, no watcher, no +persistent observation token and no topology freeze claim. + +Microsoft documents +[OBJ_DONT_REPARSE](https://learn.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_object_attributes) +as refusing reparse traversal. The reader avoids combining `FILE_DIRECTORY_FILE` +with flags outside the compatibility list in +[NtCreateFile](https://learn.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntcreatefile). +It requests attribute access, shares read/write/delete and never creates or +writes files. It supports ordinary absolute drive paths; unsupported namespaces +or platforms use reference validation. Ordinary I/O errors are not converted to +successful negative observations. + +The private `native-shadow` mode substitutes this reader into the existing +registry comparisons and record authentication, without removing the cross +product or fresh physical-ancestry checks. It then **always runs the ordinary +reference validator**. Native disagreement/errors fail closed if reference accepts; +reference rejection propagates. A known capability failure falls back to reference. +The native pass leaves abandoned-state cleanup to reference and never initializes +claims or reconciles outputs. Close failures also require reference verification +and cannot authorize initialization. + +The native API bindings can survive the phase; filesystem observations and +handles cannot. Counters explicitly include native opens, attribute/final-path +queries and successful handle closes, so opaque ctypes calls are not reported as +eliminated filesystem work. Benchmark fingerprints include all three helper files. + +## Why read-only handles do not prove operation-wide reuse + +A real Windows adversarial test held an ordinary directory open with +`FILE_READ_ATTRIBUTES`, allowing only read sharing. A second attribute-only +handle still converted that directory into a junction with +`FSCTL_SET_REPARSE_POINT`. The native observer rejected the changed path on its +next call. The counterexample passed on this host; it was not a simulated alias. + +This is consistent with Microsoft's +[sharing rules](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew), +which exclude attribute access from ordinary sharing restrictions, and the +[reparse operation specification](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fsa/4aeefef8-92c3-4abc-af7a-a610caf8a165), +which permits the operation through write-attributes access. Keeping existing +directory handles open is therefore insufficient to retain cached name/geometry +authority. Missing children also cannot be protected by an ordinary read handle. + +Directory-content oplock breaks remain advisory, as described in +[the initial contract](experimental-index-contract.md). USN journals are not a +drop-in proof either: reasons accumulate until close, so a complete protocol +must address existing open writers, forced posting, journal continuity and all +name/object dependencies. A bounded capability probe on this host could post a +close record for a new test directory, but a zero-access volume journal query +returned `ERROR_INVALID_FUNCTION`. No journal was created, resized or configured, +no elevation was requested for the application, and no journal-based authority +was implemented. These probe results do not establish availability on other hosts. + +## Measurements and stop decision + +The second measurement and the earlier four-case pilot are in +[observation-mechanism-results.json](observation-mechanism-results.json). Each +sample uses a fresh explicit synthetic registry and real locked fixture setup. +All timings include instrumentation and uncontrolled workstation/cache effects. + +At **64 retained claims / 11 current plans**: + +| Work | Pilot seconds | Second sample seconds | +| --- | ---: | ---: | +| Native fresh registry-validation phase | 9.197 | 11.421 | +| Mandatory reference registry-validation phase | 18.208 | 20.254 | +| Both registry phases | 27.405 | 31.677 | +| Separate current-plan validation | 0.852 | 1.556 | +| Complete reconciliation, including locks and output-state work | 29.591 | 35.245 | +| Separate fixture setup | 8.917 | 12.454 | + +Each sample retains its measured source fingerprints. After the second sample, +the explicit extended-path namespace was conservatively restricted to reference +fallback because stripping that prefix would change existing ownership-key +spelling. This capability restriction was tested separately; the timings above +are not relabeled as measurements of that final source snapshot. + +The native phase made **7,621 projections**, **14,663 opens**, **7,621 attribute +queries** and **7,621 final-path queries**. All **7,621 opened handles closed**. +Every one of the 64 retained claims/plans was authenticated in each relevant +phase. The full report retains both Python filesystem counters and native counters. + +This is a smaller fixture than the 2,172/11 target, already consuming most of the +30-second budget in shadow mode. The native phase still repeats work across the +claim/plan cross product. A size-only projection of 9.197 seconds to 2,172 claims +would be roughly 312 seconds for that phase, **not a measurement or a lower +bound**. This mechanism fails the research cost gate; it is not reasonable to +claim that a small native-API substitution solves the target. No authoritative +index mode or automatic promotion was added, and no large reference run was +performed merely to reproduce another several-minute failure. + +## Correctness and upgrade evidence + +- Default regression suite: **1,772 passed, 41 skipped**. +- Existing coordinator suite with native-shadow: **87 passed, 6 skipped**. +- New observation tests: **22 passed**, including real reparse conversion, + fresh missing/existing transitions, file/directory distinctions, scope expiry, + unexpected status/permission failures, handle cleanup, fallback, and rejection + before new claims after a foreign replacement. +- Minimum-version check on CPython 3.12.9: **48 passed** observation/index tests, + including an existing explicit-namespace claim retaining its token and record + through reference fallback. +- CMake integration: **18 passed, 1 skipped**, including both shadow modes from + an installed, relocated package with an unchanged prefix. +- **51 cross-version upgrade/rollback/recovery cases passed** against the exact + public protocol-v1 coordinator cited in #54, including native-shadow in both + directions. Claim tokens, plan digests and unchanged output bytes/mtimes survive; + publication, initialization and reset crash cuts recover across versions. + +The file-lock implementation and twelve mutation/recovery/lock methods remain +unchanged from preservation checkpoint `f804fd1`. The reference validator now has +an explicit reader adapter; default behavioral regressions and cross-version +tests verify that path rather than claiming its AST remains byte-for-byte equal. +Protocol v1, registry namespace, public CMake calls, generator/runtime and normal +user commands remain unchanged. The optional module installs next to the existing +helpers and needs no extra Python package, service or native helper build. + +## Remaining gate + +This work establishes a conservative fresh-observation primitive under reference +authority and disproves one proposed reuse mechanism. It does **not** establish +operation-wide observation validity. Promotion still requires an independently +reviewable dependency-lifetime/commit argument, adversarial tests for that exact +mechanism and repeated full-validation measurements below 30 seconds with margin. +A timestamp, two matching sweeps, read-sharing restrictions or a watcher cannot +substitute for that argument. Retaining correctness and easy upgrades takes +precedence over enabling the index. diff --git a/docs/wiki/Contributing.md b/docs/wiki/Contributing.md index ab2ce20..2b569c5 100644 --- a/docs/wiki/Contributing.md +++ b/docs/wiki/Contributing.md @@ -125,6 +125,13 @@ during a measurement. See the experiment's [correctness contract](../experimental-index-contract.md) before interpreting the preview numbers. The default coordinator remains reference mode. +The fresh native-reader investigation can be measured with +`--registry-validation native-shadow` in the scaling benchmark or POC. It keeps +the cross product and fresh physical checks, then always runs reference validation. +Native open/query/close counters and all three source fingerprints are reported. +This mode is an experiment and has not passed the large-workload timing gate; +see [its results and counterexample](../observation-mechanism-results.md). + ## Documentation The canonical wiki source is `docs/wiki/` in the main repository. Edit and diff --git a/tests/benchmark_output_registry.py b/tests/benchmark_output_registry.py index 8d08959..7358389 100644 --- a/tests/benchmark_output_registry.py +++ b/tests/benchmark_output_registry.py @@ -87,9 +87,10 @@ def encode(value: Path | str) -> str: def _implementation_fingerprint(module: ModuleType) -> dict[str, str]: paths = [Path(module.__file__)] - helper = paths[0].with_name("ProtocyteOwnershipIndex.py") - if helper.is_file(): - paths.append(helper) + for name in ("ProtocyteOwnershipIndex.py", "ProtocytePathObservation.py"): + helper = paths[0].with_name(name) + if helper.is_file(): + paths.append(helper) return {path.name: hashlib.sha256(path.read_bytes()).hexdigest() for path in paths} @@ -343,7 +344,9 @@ def main() -> None: parser.add_argument("--shared-build-root", action="store_true") parser.add_argument("--existing-directories", action="store_true") parser.add_argument( - "--registry-validation", choices=("reference", "shadow"), default="reference" + "--registry-validation", + choices=("reference", "shadow", "native-shadow"), + default="reference", ) parser.add_argument( "--large", diff --git a/tests/registry_validation_poc.py b/tests/registry_validation_poc.py index 231462a..2fd8c19 100644 --- a/tests/registry_validation_poc.py +++ b/tests/registry_validation_poc.py @@ -232,7 +232,9 @@ def main(): parser.add_argument("--repeat", type=int, default=1) parser.add_argument("--work", type=Path) parser.add_argument( - "--registry-validation", choices=("reference", "shadow"), default="reference" + "--registry-validation", + choices=("reference", "shadow", "native-shadow"), + default="reference", ) args = parser.parse_args() if ( @@ -255,7 +257,11 @@ def main(): "coordinator_sha256": hashlib.sha256(source.read_bytes()).hexdigest(), "implementation_files": { path.name: hashlib.sha256(path.read_bytes()).hexdigest() - for path in (source, source.with_name("ProtocyteOwnershipIndex.py")) + for path in ( + source, + source.with_name("ProtocyteOwnershipIndex.py"), + source.with_name("ProtocytePathObservation.py"), + ) if path.is_file() }, "timings_include_instrumentation": True, @@ -271,7 +277,11 @@ def main(): } observed_files = { path.name: hashlib.sha256(path.read_bytes()).hexdigest() - for path in (source, source.with_name("ProtocyteOwnershipIndex.py")) + for path in ( + source, + source.with_name("ProtocyteOwnershipIndex.py"), + source.with_name("ProtocytePathObservation.py"), + ) if path.is_file() } if observed_files != result["implementation_files"]: diff --git a/tests/test_output_coordinator_cmake.py b/tests/test_output_coordinator_cmake.py index 7571dfc..8944db8 100644 --- a/tests/test_output_coordinator_cmake.py +++ b/tests/test_output_coordinator_cmake.py @@ -62,8 +62,13 @@ def test_default_registry_selector_uses_the_isolated_test_cache(tmp_path: Path) ) +@pytest.mark.parametrize( + "experimental_flag", + ["--experimental-registry-index", "--experimental-native-observation"], +) def test_installed_shadow_coordinator_is_relocatable_and_keeps_prefix_unchanged( tmp_path: Path, + experimental_flag: str, ) -> None: _, prefix = _test_cmake._configure_fetchcontent_install_fixture( tmp_path, protocyte_install=True @@ -72,6 +77,7 @@ def test_installed_shadow_coordinator_is_relocatable_and_keeps_prefix_unchanged( prefix.rename(relocated) script = next(relocated.rglob("ProtocyteOutputCoordinator.py")) assert script.with_name("ProtocyteOwnershipIndex.py").is_file() + assert script.with_name("ProtocytePathObservation.py").is_file() def contents() -> dict[str, bytes]: return { @@ -115,7 +121,7 @@ def encoded(path: Path | str) -> str: str(tmp_path / "locks"), "--plan", str(plan), - "--experimental-registry-index", + experimental_flag, ], check=False, capture_output=True, diff --git a/tests/test_path_observation.py b/tests/test_path_observation.py new file mode 100644 index 0000000..0392dbc --- /dev/null +++ b/tests/test_path_observation.py @@ -0,0 +1,361 @@ +from __future__ import annotations + +import importlib.util +import ctypes +import os +import struct +import sys +from pathlib import Path + +import pytest + + +_spec = importlib.util.spec_from_file_location( + "path_observation_test_helpers", + Path(__file__).with_name("test_output_coordinator.py"), +) +assert _spec is not None and _spec.loader is not None +_helpers = importlib.util.module_from_spec(_spec) +sys.modules[_spec.name] = _helpers +_spec.loader.exec_module(_helpers) +coordinator = _helpers.coordinator +native = coordinator._load_path_observation() + + +@pytest.fixture +def observer(): + if os.name != "nt": + pytest.skip("native no-reparse opens require Windows") + reader = native.FreshPathObserver() + try: + yield reader + finally: + reader.close() + assert reader.handles_opened == reader.handles_closed + + +def _plan(tmp_path: Path, name: str): + return _helpers._write_plan( + tmp_path / f"{name}.plan", + tmp_path / name / "generated", + tmp_path / name / "build", + ((_helpers._target(name), "sample.protocyte.hpp"),), + ) + + +@pytest.mark.parametrize("missing_depth", [0, 1, 6]) +def test_native_projection_matches_reference_for_existing_and_missing_paths( + tmp_path: Path, observer, missing_depth: int +) -> None: + existing = tmp_path / "mixed Case ü 🧬" + existing.mkdir() + path = existing.joinpath(*(f"missing-{n}" for n in range(missing_depth))) + assert observer.project(path) == coordinator.project_path(path) + assert observer.handles_opened == observer.handles_closed + assert observer.project(path) == coordinator.project_path(path) + assert observer.projections == 2 + + +def test_native_observations_do_not_cache_absence_or_existing_identity( + tmp_path: Path, observer +) -> None: + path = tmp_path / "changing" + assert observer.project(path) == path + opened = observer.open_calls + path.mkdir() + assert observer.project(path) == path + assert observer.open_calls > opened + path.rmdir() + path.write_text("foreign file") + with pytest.raises(native.UnsafeObservation, match="non-directory"): + observer.project(path) + + +def test_native_projection_distinguishes_regular_file_leaf_from_ancestor( + tmp_path: Path, observer +) -> None: + path = tmp_path / "sample.json" + path.write_text("{}") + assert observer.project(path, leaf_may_be_file=True) == path + for candidate in (path, path / "nested"): + with pytest.raises((native.UnsafeObservation, OSError)): + observer.project(candidate) + + +def test_native_reparse_traversal_is_rejected_at_leaf_and_ancestor( + tmp_path: Path, observer +) -> None: + target = tmp_path / "ordinary" + target.mkdir() + link = tmp_path / "link" + _helpers._directory_link(link, target) + for path in (link, link / "missing", link / "missing" / "leaf"): + with pytest.raises((native.UnsafeObservation, OSError)): + observer.project(path) + + +def test_native_rejects_missing_ancestor_replaced_by_junction_on_next_call( + tmp_path: Path, observer +) -> None: + path = tmp_path / "missing" / "generated" + assert observer.project(path) == path + outside = tmp_path / "outside" + outside.mkdir() + _helpers._directory_link(path.parent, outside) + with pytest.raises((native.UnsafeObservation, OSError)): + observer.project(path) + + +def test_readonly_handle_cannot_be_treated_as_a_reparse_stability_lease( + tmp_path: Path, observer +) -> None: + """Counterexample to promoting share-restricted handles into cached authority.""" + from ctypes import wintypes as w + + victim, target = tmp_path / "victim", tmp_path / "target" + victim.mkdir() + target.mkdir() + create = observer._kernel.CreateFileW + create.argtypes = ( + w.LPCWSTR, + w.DWORD, + w.DWORD, + w.LPVOID, + w.DWORD, + w.DWORD, + w.HANDLE, + ) + create.restype = w.HANDLE + control = observer._kernel.DeviceIoControl + control.argtypes = ( + w.HANDLE, + w.DWORD, + w.LPVOID, + w.DWORD, + w.LPVOID, + w.DWORD, + ctypes.POINTER(w.DWORD), + w.LPVOID, + ) + control.restype = w.BOOL + invalid = ctypes.c_void_p(-1).value + handles = [] + try: + # Denying write/delete sharing does not constrain attribute-only access. + pin = create(str(victim), 0x80, 1, None, 3, 0x02200000, None) + assert pin != invalid + handles.append(pin) + writer = create(str(victim), 0x100, 7, None, 3, 0x02200000, None) + assert writer != invalid + handles.append(writer) + substitute = ("\\??\\" + str(target)).encode("utf-16-le") + printable = str(target).encode("utf-16-le") + names = substitute + b"\x00\x00" + printable + b"\x00\x00" + data = ( + struct.pack( + " None: + def fail(*args, **kwargs): + raise RuntimeError("injected description failure") + + monkeypatch.setattr(observer, "_describe", fail) + with pytest.raises(RuntimeError, match="description failure"): + observer.project(tmp_path) + assert observer.handles_opened == observer.handles_closed + observer.close() + with pytest.raises(native.UnsafeObservation, match="outside its scope"): + observer.project(tmp_path) + + +def test_unexpected_success_status_closes_its_native_handle( + tmp_path: Path, observer, monkeypatch: pytest.MonkeyPatch +) -> None: + original = observer._open + + def informational(*args): + assert original(*args) == 0 + return 1 + + monkeypatch.setattr(observer, "_open", informational) + with pytest.raises(native.UnsafeObservation, match="unsupported result"): + observer.project(tmp_path) + assert observer.handles_opened == observer.handles_closed == 1 + + +def test_permission_error_is_not_cached_or_reinterpreted_as_absence( + tmp_path: Path, observer, monkeypatch: pytest.MonkeyPatch +) -> None: + monkeypatch.setattr(observer, "_open", lambda *args: -1073741790) # ACCESS_DENIED + with pytest.raises(PermissionError): + observer.project(tmp_path) + assert observer.open_calls == 1 + assert observer.handles_opened == 0 + + +@pytest.mark.parametrize( + "name", + ["relative", "C:\\data:stream", "\\\\server\\share\\folder", "\\\\?\\C:\\folder"], +) +def test_unsupported_names_cannot_acquire_native_authority(name: str) -> None: + with pytest.raises(native.ObservationUnavailable): + native.FreshPathObserver._native_name(Path(name)) + + +def test_default_validation_never_loads_native_observer( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + def unexpected(): + pytest.fail("reference validation loaded the native observer") + + monkeypatch.setattr(coordinator, "_load_path_observation", unexpected) + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="reference" + ) + assert engine.reconcile(_plan(tmp_path, "current")) + + +def test_native_shadow_authenticates_all_records_and_reference_remains_authority( + tmp_path: Path, +) -> None: + if os.name != "nt": + pytest.skip("native no-reparse opens require Windows") + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="native-shadow" + ) + engine.reconcile_set((), [_plan(tmp_path, "first"), _plan(tmp_path, "second")]) + assert engine.reconcile(_plan(tmp_path, "current")) + metrics = engine.validation_metrics + assert metrics["authoritative"] == "reference" + assert metrics["agreement"] is True + assert metrics["native_claims_checked"] == 2 + assert metrics["native_handles_opened"] == metrics["native_handles_closed"] + + +def test_native_capability_failure_uses_reference_without_migration_or_new_flags( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + def unavailable(): + raise native.ObservationUnavailable("injected unsupported filesystem") + + monkeypatch.setattr(native, "FreshPathObserver", unavailable) + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="native-shadow" + ) + assert engine.reconcile(_plan(tmp_path, "current")) + assert engine.validation_metrics["fallback"] == "reference" + assert engine.validation_metrics["agreement"] is None + + +def test_extended_namespace_upgrade_preserves_claim_through_reference_fallback( + tmp_path: Path, +) -> None: + if os.name != "nt": + pytest.skip("explicit Windows namespace paths require Windows") + root = Path("\\\\?\\" + str(tmp_path / "generated")) + plan = _helpers._write_plan( + tmp_path / "extended.plan", + root, + tmp_path / "build", + ((_helpers._target("extended"), "sample.protocyte.hpp"),), + ) + locks = tmp_path / "locks" + reference = coordinator.OutputCoordinator(locks, registry_validation="reference") + token = reference.reconcile(plan) + before = (reference._state_directory(plan.root) / "claim.json").read_bytes() + observed = coordinator.OutputCoordinator(locks, registry_validation="native-shadow") + assert observed.reconcile(plan) == token + assert observed.validation_metrics["fallback"] == "reference" + assert (reference._state_directory(plan.root) / "claim.json").read_bytes() == before + + +def test_native_sample_error_cannot_authorize_even_if_reference_accepts( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + def broken(): + raise RuntimeError("injected observer failure") + + monkeypatch.setattr(native, "FreshPathObserver", broken) + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="native-shadow" + ) + with pytest.raises(coordinator.CoordinatorError, match="disagrees"): + engine.reconcile(_plan(tmp_path, "current")) + assert engine.validation_metrics["reference_result"] == "accepted" + assert not list((engine.lock_root / "roots").glob("*/claim.json")) + + +def test_native_scope_close_error_still_runs_reference_before_fail_closed( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + if os.name != "nt": + pytest.skip("native no-reparse opens require Windows") + original = native.FreshPathObserver.close + + def broken_close(self): + original(self) + raise RuntimeError("injected scope close failure") + + monkeypatch.setattr(native.FreshPathObserver, "close", broken_close) + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="native-shadow" + ) + with pytest.raises(coordinator.CoordinatorError, match="disagrees"): + engine.reconcile(_plan(tmp_path, "current")) + assert engine.validation_metrics["reference_result"] == "accepted" + assert not list((engine.lock_root / "roots").glob("*/claim.json")) + + +def test_foreign_replacement_after_native_phase_is_rejected_before_new_claims( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + if os.name != "nt": + pytest.skip("native no-reparse opens require Windows") + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="native-shadow" + ) + retained = _plan(tmp_path, "retained") + engine.reconcile(retained) + + def replace(stage: str): + if stage == "after-native-observation": + retained.root.touch() + + monkeypatch.setattr(engine, "_inject", replace) + with pytest.raises(coordinator.CoordinatorError, match="non-directory"): + engine.reconcile(_plan(tmp_path, "current")) + assert engine.validation_metrics["preview_result"] == "accepted" + assert engine.validation_metrics["reference_result"] == "rejected" + assert len(list((engine.lock_root / "roots").glob("*/claim.json"))) == 1 From 0fe8ad4cf6458d188b06e45a8bb3df74408242ec Mon Sep 17 00:00:00 2001 From: Anthony Printup <92564080+anthonyprintup@users.noreply.github.com> Date: Mon, 16 Nov 2026 16:00:40 +0100 Subject: [PATCH 06/12] perf(coordinator): prototype optimistic observation commits Add a private commit-shadow experiment that authenticates every ownership record, reuses provisional positive geometry, and requires exact file-ID/USN close witnesses before accepting its read set. Keep missing-path comparisons fresh in both directions and close ordinary directory handles immediately. Restrict positive reuse to canonical spellings because case-mode changes need not advance NTFS USNs. Unsupported, changed, or failed observations fall back to the reference validator, which remains the default and sole authority. Install the helper beside the coordinator, add native filesystem accounting and complete read-only candidate benchmarks, and publish the consistency contract plus source-fingerprinted measurements. Remove the slower bounded parent-lease variant. Final quiet 2,172-claim/11-plan samples take 18.58-25.32s; a fourth 22.06s candidate agrees with the full 310.04s reference oracle. Reliability, contention and consistency qualification remain open, so no indexed authorization mode is enabled. Reject dangling retained plan links and inaccessible metadata instead of treating them as absent; only FileNotFoundError permits a missing record. Add native ABA, witness-corruption, fallback, lifecycle, ownership partition, and packaging coverage, plus an offline old/new upgrade qualification driver. Preserve protocol v1, claim tokens, lock paths, and recovery/publication formats. Validation: - Default suite: 1,834 passed, 41 skipped. - Commit-shadow coordinator suite: 89 passed, 6 skipped. - Minimum Python 3.12 observation/index and metadata suite: 109 passed. - CMake and installed relocation: 19 passed, 1 skipped. - Upgrade/rollback and nine crash cuts: 71 passed cases. - Final-source shadow/reference agreement on both synthetic layouts. - Ruff, formatting, source fingerprints, and private-path guard passed. --- CMakeLists.txt | 1 + cmake/ProtocyteObservationCommit.py | 928 +++++++++++++++ cmake/ProtocyteOutputCoordinator.py | 144 ++- docs/experimental-index-contract.md | 6 + docs/observation-commit-contract.md | 193 +++ docs/observation-commit-results.json | 1492 ++++++++++++++++++++++++ docs/observation-commit-results.md | 200 ++++ tests/benchmark_observation_commit.py | 183 +++ tests/benchmark_output_registry.py | 20 +- tests/registry_validation_poc.py | 4 +- tests/test_observation_commit.py | 658 +++++++++++ tests/test_output_coordinator.py | 62 + tests/test_output_coordinator_cmake.py | 3 +- tests/verify_coordinator_upgrade.py | 398 +++++++ 14 files changed, 4281 insertions(+), 11 deletions(-) create mode 100644 cmake/ProtocyteObservationCommit.py create mode 100644 docs/observation-commit-contract.md create mode 100644 docs/observation-commit-results.json create mode 100644 docs/observation-commit-results.md create mode 100644 tests/benchmark_observation_commit.py create mode 100644 tests/test_observation_commit.py create mode 100644 tests/verify_coordinator_upgrade.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 17f16bd..00f89c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,6 +176,7 @@ if(PROTOCYTE_INSTALL) "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteOutputCoordinator.py" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteOwnershipIndex.py" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocytePathObservation.py" + "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteObservationCommit.py" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteResetOutputDirectory.cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteFunctions.cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/ProtocyteProcess.cmake" diff --git a/cmake/ProtocyteObservationCommit.py b/cmake/ProtocyteObservationCommit.py new file mode 100644 index 0000000..2786b89 --- /dev/null +++ b/cmake/ProtocyteObservationCommit.py @@ -0,0 +1,928 @@ +"""Experimental optimistic read-set commit; never standalone mutation authority. + +Positive objects use root-anchored short opens and exact ID/version witnesses. +Only volume roots retain handles; foreign build directories are not pinned. +Negative namespace observations are refreshed at every comparison and commit. +The coordinator still performs its ordinary reference validation afterward. +""" + +from __future__ import annotations + +import ctypes +import contextlib +import json +import os +import struct +from dataclasses import dataclass +from pathlib import Path +from typing import Any, Iterable, Mapping + + +class CommitUnavailable(RuntimeError): + pass + + +class CapabilityUnavailable(CommitUnavailable): + pass + + +class ObservationChanged(RuntimeError): + pass + + +CLOSE_REASON = 0x80000000 + + +@dataclass(frozen=True) +class JournalRecord: + usn: int + file_id: int + reason: int + + +def parse_journal_page(data: bytes) -> tuple[int, tuple[JournalRecord, ...]]: + """Decode headers only; never retain names or unrelated filesystem paths.""" + if len(data) < 8: + raise CommitUnavailable("short journal cursor") + cursor = struct.unpack_from(" len(data): + raise CommitUnavailable("invalid journal record length") + width = 8 if major == 2 else 16 + file_id = int.from_bytes(data[offset + 8 : offset + 8 + width], "little") + usn_offset = offset + (24 if major == 2 else 40) + usn = struct.unpack_from("= cursor + or name_length % 2 + or ( + name_length + and ( + name_offset < minimum + or name_offset % 2 + or name_offset + name_length > length + ) + ) + ): + raise CommitUnavailable("invalid journal record fields") + records.append(JournalRecord(usn, file_id, reason)) + previous = usn + offset += length + return cursor, tuple(records) + + +def verify_witnesses( + expected: Mapping[int, int], records: Iterable[JournalRecord] +) -> None: + """Require positive evidence for every requested USN; absence never succeeds.""" + found: set[int] = set() + for record in records: + if record.usn not in expected: + continue + if record.usn in found or record.file_id != expected[record.usn]: + raise CommitUnavailable("duplicate or misbound close witness") + if record.reason != CLOSE_REASON: + raise ObservationChanged("close witness contains accumulated changes") + found.add(record.usn) + if found != set(expected): + raise CommitUnavailable("incomplete close witnesses") + + +@dataclass +class _Guard: + handle: Any + volume: int + file_id: int + start_usn: int + is_directory: bool + request: Any = None + + +@dataclass(frozen=True) +class _View: + path: Path + facts: Any + guard: _Guard + missing: tuple[str, ...] = () + probe: Any = None + relative: str = "" + + +@dataclass +class _Volume: + handle: Any + epoch: int + first: int + + +class WindowsObservationCommit: + """One bounded read set; instances and facts are never shared across phases.""" + + MAX_OBJECTS = 32768 + MAX_JOURNAL_BYTES = 64 * 1024 * 1024 + MAX_RECORD_BYTES = 16 * 1024 * 1024 + + def __init__(self, native: Any, model: Any) -> None: + if os.name != "nt": + raise CapabilityUnavailable("commit observations require Windows") + self.native, self.model = native, model + self.reader = native.FreshPathObserver() + self.w = self.reader._w + self._state = "active" + self._objects: dict[tuple[int, int], _Guard] = {} + self._volumes: dict[int, _Volume] = {} + self._roots: dict[str, _View] = {} + self._views: dict[str, _View] = {} + self._bindings: list[tuple[_Guard, str, tuple[int, int] | None, Any]] = [] + self._inventories: list[ + tuple[_Guard, tuple[str, ...], frozenset[str] | None] + ] = [] + self._counts = { + name: 0 + for name in ( + "commit_open_calls", + "commit_info_calls", + "commit_negative_probes", + "commit_close_posts", + "commit_version_reads", + "commit_epoch_queries", + "commit_journal_reads", + "commit_journal_bytes", + "commit_witnesses", + "commit_records_read", + "commit_binding_checks", + "commit_record_read_calls", + "commit_record_seek_calls", + "commit_directory_enumerations", + "commit_full_inventory_scans", + ) + } + + class FileId(ctypes.Structure): + _fields_ = [("Volume", ctypes.c_ulonglong), ("Id", ctypes.c_ubyte * 16)] + + class Basic(ctypes.Structure): + _fields_ = [("Times", ctypes.c_longlong * 4), ("Attributes", self.w.ULONG)] + + self._id_type, self._basic_type = FileId, Basic + self._control = self.reader._kernel.DeviceIoControl + self._control.argtypes = ( + self.w.HANDLE, + self.w.DWORD, + self.w.LPVOID, + self.w.DWORD, + self.w.LPVOID, + self.w.DWORD, + ctypes.POINTER(self.w.DWORD), + self.w.LPVOID, + ) + self._control.restype = self.w.BOOL + self._query = self.reader._nt.NtQueryAttributesFile + self._query.argtypes = ( + ctypes.POINTER(self.reader._attributes), + ctypes.POINTER(Basic), + ) + self._query.restype = self.w.LONG + self._read = self.reader._kernel.ReadFile + self._read.argtypes = ( + self.w.HANDLE, + self.w.LPVOID, + self.w.DWORD, + ctypes.POINTER(self.w.DWORD), + self.w.LPVOID, + ) + self._read.restype = self.w.BOOL + self._seek = self.reader._kernel.SetFilePointerEx + self._seek.argtypes = ( + self.w.HANDLE, + ctypes.c_longlong, + ctypes.POINTER(ctypes.c_longlong), + self.w.DWORD, + ) + self._seek.restype = self.w.BOOL + self._fs_info = self.reader._kernel.GetVolumeInformationByHandleW + self._fs_info.argtypes = ( + self.w.HANDLE, + self.w.LPWSTR, + self.w.DWORD, + ctypes.POINTER(self.w.DWORD), + ctypes.POINTER(self.w.DWORD), + ctypes.POINTER(self.w.DWORD), + self.w.LPWSTR, + self.w.DWORD, + ) + self._fs_info.restype = self.w.BOOL + + def _active(self) -> None: + if self._state != "active": + raise ObservationChanged("read set used outside its observation phase") + + def _io( + self, handle: Any, code: int, request: bytes | None, capacity: int + ) -> bytes: + incoming = ctypes.create_string_buffer(request) if request is not None else None + output = ctypes.create_string_buffer(capacity) + size = self.w.DWORD() + if not self._control( + handle, + code, + incoming, + len(request) if request else 0, + output, + capacity, + ctypes.byref(size), + None, + ): + raise CapabilityUnavailable( + f"journal operation unavailable ({ctypes.get_last_error()})" + ) + if size.value > capacity: + raise CommitUnavailable("oversized journal reply") + return output.raw[: size.value] + + def _epoch(self, handle: Any) -> tuple[int, int, int]: + self._counts["commit_epoch_queries"] += 1 + data = self._io(handle, 0x900F4, None, 128) + if len(data) < 56: + raise CommitUnavailable("short journal information") + epoch, first, next_usn, lowest = struct.unpack_from(" next_usn + or lowest > next_usn + ): + raise CommitUnavailable("invalid journal information") + return epoch, max(first, lowest), next_usn + + def _post_close(self, handle: Any) -> int: + self._counts["commit_close_posts"] += 1 + data = self._io(handle, 0x900EF, None, 8) + if len(data) != 8: + raise CommitUnavailable("short close marker") + usn = struct.unpack(" int: + self._counts["commit_version_reads"] += 1 + data = self._io(handle, 0x900EB, struct.pack(" len(data): + raise CommitUnavailable("unsupported file version") + return struct.unpack_from(" tuple[int, int]: + self._counts["commit_info_calls"] += 1 + value = self._id_type() + if not self.reader._info(handle, 18, ctypes.byref(value), ctypes.sizeof(value)): + raise CapabilityUnavailable("128-bit object identity unavailable") + key = value.Volume, int.from_bytes(bytes(value.Id), "little") + if not key[0] or not key[1]: + raise CommitUnavailable("empty object identity") + return key + + def _release(self, handle: Any) -> None: + if not self.reader._close(handle): + raise CommitUnavailable("native handle release failed") + self.reader.handles_closed += 1 + + def _adopt( + self, handle: Any, *, request: Any = None, retain_root: bool = False + ) -> tuple[_Guard, Path]: + retained = False + try: + key = self._identity(handle) + known = self._objects.get(key) + if known is None: + if len(self._objects) >= self.MAX_OBJECTS: + raise CommitUnavailable("read set object budget exceeded") + if key[0] not in self._volumes: + if not retain_root: + raise CommitUnavailable( + "relative lookup crossed a volume boundary" + ) + filesystem = ctypes.create_unicode_buffer(32) + self._counts["commit_info_calls"] += 1 + if ( + not self._fs_info( + handle, + None, + 0, + None, + None, + None, + filesystem, + len(filesystem), + ) + or filesystem.value != "NTFS" + ): + raise CapabilityUnavailable( + "only local NTFS supports this prototype" + ) + epoch, first, _ = self._epoch(handle) + self._volumes[key[0]] = _Volume(handle, epoch, first) + start = self._post_close(handle) + # Facts are collected only after the initial close marker. + tag = self.reader._tag() + self._counts["commit_info_calls"] += 1 + if not self.reader._info( + handle, 9, ctypes.byref(tag), ctypes.sizeof(tag) + ): + raise CommitUnavailable("attribute information unavailable") + if tag.Attributes & 0x400: + raise ObservationChanged("observed reparse point") + is_directory = bool(tag.Attributes & 0x10) + if is_directory: + # This is a capability gate, not a versioned fact. NTFS can + # change this flag without changing the file USN. Reuse is + # restricted to exact canonical names below, whose binding + # does not depend on case-insensitive alias lookup. + case = self.w.DWORD() + self._counts["commit_info_calls"] += 1 + if ( + not self.reader._info( + handle, 23, ctypes.byref(case), ctypes.sizeof(case) + ) + or case.value + ): + raise CapabilityUnavailable( + "case-sensitive directory needs reference validation" + ) + known = _Guard( + handle if retain_root else None, + key[0], + key[1], + start, + is_directory, + request, + ) + self._objects[key] = known + retained = retain_root + canonical = self.reader._describe(handle, leaf_may_be_file=True) + return known, canonical + finally: + if not retained: + self._release(handle) + + def _request(self, parent: _View, component: str): + if ( + not component + or component in (".", "..") + or any(c in component for c in ("\\", "/", ":", "\x00")) + ): + raise CommitUnavailable("unsupported relative component") + relative = parent.relative + ("\\" if parent.relative else "") + component + length = len(relative.encode("utf-16-le")) + if length > 65532: + raise CommitUnavailable("relative component too long") + storage = ctypes.create_unicode_buffer(relative) + name = self.reader._unicode( + length, length + 2, ctypes.cast(storage, self.w.LPWSTR) + ) + attributes = self.reader._attributes( + ctypes.sizeof(self.reader._attributes), + self._volumes[parent.guard.volume].handle, + ctypes.pointer(name), + 0x1040, + None, + None, + ) + return storage, name, attributes + + def _open_child(self, request: Any): + self._counts["commit_open_calls"] += 1 + handle, status = self.w.HANDLE(), self.reader._status() + result = self.reader._open( + ctypes.byref(handle), + 0x100081, + ctypes.byref(request[2]), + ctypes.byref(status), + None, + 0, + 7, + 1, + 0x20, + None, + 0, + ) + code = result & 0xFFFFFFFF + if code in (0xC0000034, 0xC000003A): + return None + if result < 0: + raise ObservationChanged( + f"relative open changed or unavailable ({code:08x})" + ) + if not handle.value: + raise CommitUnavailable("relative open returned no handle") + self.reader.handles_opened += 1 + if code: + self._release(handle) + raise CommitUnavailable("unexpected relative-open status") + return handle + + def _probe_absence(self, request: Any) -> None: + self._counts["commit_negative_probes"] += 1 + value = self._basic_type() + code = self._query(ctypes.byref(request[2]), ctypes.byref(value)) & 0xFFFFFFFF + if code not in (0xC0000034, 0xC000003A): + raise ObservationChanged("missing component changed during comparison") + + def _root(self, path: Path) -> _View: + self.reader._native_name(path) + root = Path(path.anchor) + key = str(root).casefold() + if key not in self._roots: + self._counts["commit_open_calls"] += 1 + handle = self.reader._open_existing(root) + if handle is None: + raise CommitUnavailable("drive root unavailable") + guard, canonical = self._adopt(handle, retain_root=True) + if canonical != root: + raise CommitUnavailable("drive aliases need reference validation") + location = (guard.volume, guard.file_id, ()) + view = _View( + canonical, + self.model.DirectoryObservation( + str(canonical).replace("\\", "/").casefold().rstrip("/"), + location, + (location,), + ), + guard, + ) + self._roots[key] = view + self._views[str(root)] = view + return self._roots[key] + + def _view(self, path: Path, *, leaf_may_be_file: bool = False) -> _View: + self._active() + key = str(path) + known = self._views.get(key) + if known is not None: + if known.missing: + self._probe_absence(known.probe) + elif not known.guard.is_directory and not leaf_may_be_file: + raise ObservationChanged("non-directory path component") + return known + path = Path(os.path.normpath(path)) + self.reader._native_name(path) + key = str(path) + parent = self._root(path) + parts = path.parts[1:] + input_path = Path(path.anchor) + for number, component in enumerate(parts): + input_path /= component + cached = self._views.get(str(input_path)) + if cached is not None and not cached.missing: + parent = cached + if number < len(parts) - 1 and not parent.guard.is_directory: + raise ObservationChanged("non-directory ancestor") + continue + if not parent.guard.is_directory: + raise ObservationChanged("non-directory ancestor") + request = self._request(parent, component) + handle = self._open_child(request) + if handle is None: + missing = tuple(parts[number:]) + suffix = tuple(part.casefold() for part in missing) + location = (parent.guard.volume, parent.guard.file_id, suffix) + ancestors = ( + tuple( + (parent.guard.volume, parent.guard.file_id, suffix[:n]) + for n in range(len(suffix), 0, -1) + ) + + parent.facts.ancestors + ) + canonical = parent.path.joinpath(*missing) + facts = self.model.DirectoryObservation( + str(canonical).replace("\\", "/").casefold().rstrip("/"), + location, + ancestors, + ) + view = _View(canonical, facts, parent.guard, missing, request) + self._views[key] = view + self._bindings.append((parent.guard, component, None, request)) + return view + guard, canonical = self._adopt(handle, request=request) + if str(canonical) != str(input_path): + # A case-mode ABA need not post a USN change. In particular, a + # differently cased alias can disappear without changing its + # original object's ID or USN. Exact spellings still identify + # that object in either case mode; all aliases use reference. + raise CapabilityUnavailable( + "noncanonical spelling needs reference validation" + ) + self._bindings.append( + (parent.guard, component, (guard.volume, guard.file_id), request) + ) + location = (guard.volume, guard.file_id, ()) + facts = self.model.DirectoryObservation( + str(canonical).replace("\\", "/").casefold().rstrip("/"), + location, + (location, *parent.facts.ancestors), + ) + relative = parent.relative + ("\\" if parent.relative else "") + component + parent = _View(canonical, facts, guard, relative=relative) + self._views[str(input_path)] = parent + self._views.setdefault(str(canonical), parent) + if not parent.guard.is_directory and not leaf_may_be_file: + raise ObservationChanged("non-directory path component") + return parent + + def project(self, path: Path, *, leaf_may_be_file: bool = False) -> Path: + return self._view(path, leaf_may_be_file=leaf_may_be_file).path + + def facts(self, path: Path): + return self._view(path).facts + + def _descriptor(self, path: Path) -> _View: + self._active() + view = self._views.get(str(path)) + if view is None: + return self._view(path) + if not view.missing and not view.guard.is_directory: + raise ObservationChanged("non-directory path component") + return view + + def is_stable(self, path: Path) -> bool: + # A conservative classification hint, never a negative lookup result. + # Every actual comparison below refreshes its negative inputs. + return not self._descriptor(path).missing + + def path_key(self, path: Path) -> str: + import hashlib + + value = str(self.project(path)).replace("\\", "/").casefold() + return hashlib.sha256(value.encode()).hexdigest() + + def same_path(self, first: Path, second: Path) -> bool: + self._active() + if first == second: + return True + left, right = self._view(first), self._view(second) + return ( + not left.missing + and not right.missing + and left.facts.location == right.facts.location + ) + + def overlaps(self, first: Path, second: Path) -> bool: + left, right = self._descriptor(first), self._descriptor(second) + + def refresh(view: _View) -> None: + if view.missing: + self._probe_absence(view.probe) + + # Canonical positive prefixes are provisional under their version fence. + # Native negative checks combine projection and endpoint observation; + # there is no separate stale projection reused by the physical check. + refresh(left) + refresh(right) + if ( + left.facts.portable == right.facts.portable + or left.facts.portable.startswith(right.facts.portable + "/") + or right.facts.portable.startswith(left.facts.portable + "/") + ): + return True + if left.facts.location in right.facts.ancestors: + return True + refresh(right) + refresh(left) + return right.facts.location in left.facts.ancestors + + def contains(self, parent: Path, child: Path) -> bool: + first, second = self._view(parent), self._view(child, leaf_may_be_file=True) + return ( + second.facts.portable == first.facts.portable + or second.facts.portable.startswith(first.facts.portable + "/") + ) + + def physically_contains(self, parent: Path, child: Path) -> bool: + return self._view(parent).facts.location in self._view(child).facts.ancestors + + @contextlib.contextmanager + def _lease(self, guard: _Guard): + if guard.handle is not None: + yield guard.handle + return + handle = self._open_child(guard.request) + if handle is None: + raise ObservationChanged("observed object disappeared") + try: + if self._identity(handle) != (guard.volume, guard.file_id): + raise ObservationChanged("observed object identity changed") + yield handle + finally: + self._release(handle) + + def _list_handle(self, guard: _Guard) -> tuple[str, ...]: + with self._lease(guard) as handle: + return self._list_open_directory(handle) + + def _list_open_directory(self, handle: Any) -> tuple[str, ...]: + names = [] + restart = True + while True: + buffer = ctypes.create_string_buffer(65536) + self._counts["commit_info_calls"] += 1 + self._counts["commit_directory_enumerations"] += 1 + if not self.reader._info( + handle, 11 if restart else 10, buffer, len(buffer) + ): + error = ctypes.get_last_error() + if error == 18: + break + raise CommitUnavailable(f"directory enumeration unavailable ({error})") + restart = False + data = buffer.raw + offset = 0 + while True: + if offset + 104 > len(buffer): + raise CommitUnavailable("invalid directory enumeration") + (next_offset,) = struct.unpack_from(" len(buffer): + raise CommitUnavailable("invalid directory name") + name = data[offset + 104 : offset + 104 + length].decode("utf-16-le") + if name not in (".", ".."): + names.append(name) + if not next_offset: + break + if next_offset < 104 or next_offset % 8: + raise CommitUnavailable("invalid directory enumeration offset") + offset += next_offset + return tuple(sorted(names)) + + def list_names( + self, path: Path, *, relevant: frozenset[str] | None = None + ) -> tuple[str, ...]: + view = self._view(path) + if view.missing or not view.guard.is_directory: + raise ObservationChanged("registry directory disappeared") + names = self._list_handle(view.guard) + if relevant is None: + self._counts["commit_full_inventory_scans"] += 1 + observed = ( + names + if relevant is None + else tuple(name for name in names if name in relevant) + ) + self._inventories.append((view.guard, observed, relevant)) + return names + + def read_json(self, path: Path, description: str) -> dict[str, Any]: + view = self._view(path, leaf_may_be_file=True) + if view.missing or view.guard.is_directory: + raise ObservationChanged("registry record disappeared or changed type") + if view.path != path: + raise ObservationChanged("registry record path changed canonical spelling") + with self._lease(view.guard) as handle: + if self._version(handle) != view.guard.start_usn: + raise ObservationChanged("registry record changed before reading") + data = self._read_open_record(handle) + value = json.loads(data) + canonical = ( + json.dumps(value, sort_keys=True, separators=(",", ":")) + "\n" + ).encode() + if not isinstance(value, dict) or canonical != data: + raise ObservationChanged(f"{description} is not canonical JSON") + self._counts["commit_records_read"] += 1 + return value + + def _read_open_record(self, handle: Any) -> bytes: + self._counts["commit_record_seek_calls"] += 1 + if not self._seek(handle, 0, None, 0): + raise CommitUnavailable("record seek unavailable") + parts = [] + total = 0 + while True: + buffer = ctypes.create_string_buffer(65536) + size = self.w.DWORD() + self._counts["commit_record_read_calls"] += 1 + if not self._read(handle, buffer, len(buffer), ctypes.byref(size), None): + raise CommitUnavailable("record read unavailable") + if not size.value: + break + total += size.value + if total > self.MAX_RECORD_BYTES: + raise CommitUnavailable("record exceeds observation budget") + parts.append(buffer.raw[: size.value]) + return b"".join(parts) + + def record_exists(self, path: Path) -> bool: + return not self._view(path, leaf_may_be_file=True).missing + + def _collect_witnesses(self, volume: _Volume, expected: dict[int, int]) -> None: + if not expected: + return + epoch, first, next_usn = self._epoch(volume.handle) + if epoch != volume.epoch or first > min(expected) or next_usn <= max(expected): + raise ObservationChanged("journal epoch or witness range changed") + cursor = min(expected) + records = [] + remaining = set(expected) + consumed = 0 + while remaining: + request = struct.pack( + " self.MAX_JOURNAL_BYTES: + raise CommitUnavailable("journal witness budget exceeded") + following, batch = parse_journal_page(data) + if following <= cursor: + raise CommitUnavailable("journal witness cursor made no progress") + for record in batch: + if record.usn < cursor: + raise CommitUnavailable("journal witness cursor moved backward") + if record.usn in expected: + records.append(record) + remaining.discard(record.usn) + if following > max(expected) and remaining: + raise CommitUnavailable("journal omitted required witnesses") + cursor = following + verify_witnesses(expected, records) + epoch_after, _, next_after = self._epoch(volume.handle) + if epoch_after != epoch or next_after < next_usn: + raise ObservationChanged("journal changed while reading witnesses") + self._counts["commit_witnesses"] += len(expected) + + def seal(self) -> None: + self._active() + self._state = "sealing" + for guard, names, relevant in self._inventories: + current = self._list_handle(guard) + if relevant is None: + self._counts["commit_full_inventory_scans"] += 1 + current = ( + current + if relevant is None + else tuple(name for name in current if name in relevant) + ) + if current != names: + raise ObservationChanged("registry inventory changed") + for root, view in self._roots.items(): + self._counts["commit_open_calls"] += 1 + handle = self.reader._open_existing(Path(root)) + if handle is None: + raise ObservationChanged("drive binding disappeared") + try: + if self._identity(handle) != (view.guard.volume, view.guard.file_id): + raise ObservationChanged("drive binding changed") + finally: + self._release(handle) + expected: dict[int, dict[int, int]] = {volume: {} for volume in self._volumes} + certified: set[tuple[int, int]] = set() + + def certify(guard: _Guard, handle: Any) -> None: + key = guard.volume, guard.file_id + if key in certified: + return + if self._version(handle) != guard.start_usn: + raise ObservationChanged("observed object version changed") + witness = self._post_close(handle) + if witness <= guard.start_usn or witness in expected[guard.volume]: + raise CommitUnavailable("non-monotonic close witness") + expected[guard.volume][witness] = guard.file_id + certified.add(key) + + for parent, component, identity, request in self._bindings: + self._counts["commit_binding_checks"] += 1 + if identity is None: + self._probe_absence(request) + continue + handle = self._open_child(request) + if handle is None: + raise ObservationChanged("positive name binding disappeared") + try: + if self._identity(handle) != identity: + raise ObservationChanged("positive name binding changed") + certify(self._objects[identity], handle) + finally: + self._release(handle) + for guard in self._objects.values(): + if (guard.volume, guard.file_id) not in certified: + with self._lease(guard) as handle: + certify(guard, handle) + for volume, witnesses in expected.items(): + self._collect_witnesses(self._volumes[volume], witnesses) + self._state = "sealed" + + def close(self) -> None: + self._state = "closed" + error = None + for guard in reversed(tuple(self._objects.values())): + if guard.handle is None: + continue + try: + self._release(guard.handle) + except Exception as failure: + error = failure + self._objects.clear() + self._views.clear() + self._roots.clear() + self._bindings.clear() + self._inventories.clear() + self._volumes.clear() + self.reader.close() + if error is not None: + raise error + + def metrics(self) -> dict[str, Any]: + return { + **self._counts, + "commit_info_calls": self._counts["commit_info_calls"] + + self.reader.information_calls, + "commit_state": self._state, + "commit_handles_opened": self.reader.handles_opened, + "commit_handles_closed": self.reader.handles_closed, + "commit_final_path_calls": self.reader.final_path_calls, + } + + +class ProvisionalOwnershipIndex: + """Index positives; compare every unstable endpoint with fresh negatives. + + No result is usable until the associated read set supplies all close + witnesses. This object and its observations do not cross that boundary. + """ + + def __init__(self, model: Any, filesystem: WindowsObservationCommit, entries): + self.model, self.filesystem = model, filesystem + self.entries = tuple(entries) + self.positive = model.OwnershipIndex( + reservation for reservation, _, stable in self.entries if stable + ) + self.negative = tuple( + (reservation, path) + for reservation, path, stable in self.entries + if not stable + ) + self.queries = 0 + self.fresh_comparisons = 0 + + def _overlapping(self, path: Path): + self.queries += 1 + if self.filesystem.is_stable(path): + yield from self.positive.overlapping(self.filesystem.facts(path)) + remaining = self.negative + else: + remaining = tuple( + (reservation, reserved) for reservation, reserved, _ in self.entries + ) + for reservation, reserved in remaining: + self.fresh_comparisons += 1 + if self.filesystem.overlaps(reserved, path): + yield reservation + + def conflict( + self, + *, + root: Path, + root_key: str, + build_id: str, + staging, + retiring_root_keys: set[str], + ): + for reservation in self._overlapping(root): + if reservation.kind == "root": + if reservation.root_key != root_key: + return "root-root" + else: + return "root-staging" + for target, path in staging: + for reservation in self._overlapping(path): + if reservation.kind == "root": + return "staging-root" + if target == reservation.target and ( + root_key == reservation.root_key + or ( + reservation.root_key in retiring_root_keys + and build_id == reservation.build_id + ) + ): + continue + return "staging-staging" + return None diff --git a/cmake/ProtocyteOutputCoordinator.py b/cmake/ProtocyteOutputCoordinator.py index f7fedec..b5a125c 100644 --- a/cmake/ProtocyteOutputCoordinator.py +++ b/cmake/ProtocyteOutputCoordinator.py @@ -456,6 +456,8 @@ def visit(directory: Path) -> None: def _load_json(path: Path, description: str, *, _filesystem: Any = None) -> dict[str, Any]: + if _filesystem is not None and hasattr(_filesystem, "read_json"): + return _filesystem.read_json(path, description) project = project_path if _filesystem is None else _filesystem.project expected = project(path, leaf_may_be_file=True) if expected != path or _is_link(path): @@ -1055,10 +1057,32 @@ def same_path(first: Path, second: Path) -> bool: return _same_physical_path(first, second) +_observation_commit_module: Any = None + + +def _load_observation_commit() -> Any: + global _observation_commit_module + if _observation_commit_module is None: + path = Path(__file__).with_name("ProtocyteObservationCommit.py") + name = f"{__name__}_observation_commit" + spec = importlib.util.spec_from_file_location(name, path) + if spec is None or spec.loader is None: + _fail("experimental observation commit could not be loaded") + module = importlib.util.module_from_spec(spec) + sys.modules[name] = module + try: + exec(compile(path.read_bytes(), os.fspath(path), "exec"), module.__dict__) + except BaseException: + sys.modules.pop(name, None) + raise + _observation_commit_module = module + return _observation_commit_module + + class OutputCoordinator: def __init__(self, lock_root: Path, *, registry_validation: str = "reference") -> None: - if registry_validation not in ("reference", "shadow", "native-shadow"): - _fail("registry validation must be reference or shadow (including native-shadow)") + if registry_validation not in ("reference", "shadow", "native-shadow", "commit-shadow"): + _fail("registry validation must be reference or shadow (including native/commit-shadow)") self.lock_root = project_path(_require_absolute(lock_root, "output lock root")) self.registry_validation = registry_validation self.validation_metrics: dict[str, Any] = {} @@ -1481,6 +1505,27 @@ def _validate_registry( } self.validation_metrics = metrics preview_accepted: bool | None = None + if self.registry_validation == "commit-shadow": + if progress is not None: + progress.phase("validating provisional observation commit", "validation") + started = time.perf_counter() + try: + preview_accepted = self._preview_committed_index( + plans, retiring_root_keys or set(), progress=progress + ) + metrics["preview_result"] = "accepted" if preview_accepted else "conflict" + except Exception as error: + # A failed or unsupported certificate grants no authority. The + # ordinary reference path still determines this operation. + metrics["preview_result"] = "unverified" + metrics["commit_certificate"] = "unverified" + metrics["commit_failure_type"] = type(error).__name__ + metrics["fallback"] = "reference" + finally: + metrics["preview_wall_seconds"] = time.perf_counter() - started + self._inject("after-observation-commit") + if progress is not None: + progress.phase("validating registry (reference authority)", "validation") if self.registry_validation == "native-shadow": if progress is not None: progress.phase("fresh experimental path observation", "validation") @@ -1548,7 +1593,10 @@ def _validate_registry( finally: metrics["reference_wall_seconds"] = time.perf_counter() - started metrics["reference_result"] = "accepted" - if self.registry_validation in ("shadow", "native-shadow"): + if self.registry_validation in ("shadow", "native-shadow", "commit-shadow"): + if metrics.get("fallback") == "reference": + metrics["agreement"] = None + return if metrics.get("preview_result") == "unavailable": metrics["agreement"] = None metrics["fallback"] = "reference" @@ -1560,6 +1608,75 @@ def _validate_registry( "validator; no reconciliation changes were authorized" ) + def _preview_committed_index( + self, plans: Sequence[Plan], retiring_root_keys: set[str], *, + progress: _ReconcileProgress | None = None, + ) -> bool: + model = _load_ownership_index() + module = _load_observation_commit() + scope = module.WindowsObservationCommit(_load_path_observation(), model) + metrics = self.validation_metrics + metrics.update(commit_claims_checked=0, commit_certificate="unverified") + entries = [] + accepted = True + try: + internal = (self.lock_root / "roots", self.lock_root / "generation", self.lock_root / "publication") + for plan in plans: + for target in plan.targets: + if scope.contains(target.staging, self.lock_root) or scope.physically_contains(target.staging, self.lock_root): + accepted = False + if scope.overlaps(plan.root, self.lock_root) or any(scope.overlaps(path, plan.root) for path in internal): + accepted = False + roots = self.lock_root / "roots" + if plans and scope.record_exists(roots): + if scope.project(roots) != roots: + _fail("provisional commit found an unsafe registry path") + for name in scope.list_names(roots): + if not _is_sha256(name): + _fail("provisional commit found an unsafe registry entry") + state = roots / name + if scope.project(state) != state: + _fail("provisional commit found a changed registry entry") + names = scope.list_names(state, relevant=frozenset(("claim.json", "plan.json"))) + if "claim.json" not in names: + continue + source = state / "claim.json" + claim = _load_json(source, "output claim", _filesystem=scope) + self._validate_claim_shape(claim, source) + root, _ = self._claim_paths(claim, source, _filesystem=scope) + if name != claim["root_key"]: + _fail("provisional commit found a claim under the wrong key") + recorded = self._load_recorded_plan(state, claim, _filesystem=scope) + key, build = str(claim["root_key"]), str(claim["build_id"]) + entries.append((model.Reservation("root", key, build, None, scope.facts(root)), root, scope.is_stable(root))) + if recorded is not None: + for target in recorded.targets: + entries.append((model.Reservation("staging", key, build, target.identity, scope.facts(target.staging)), target.staging, scope.is_stable(target.staging))) + metrics["commit_claims_checked"] += 1 + if progress is not None: + progress.phase(f"provisional observation commit ({metrics['commit_claims_checked']} claims)", "validation") + index = module.ProvisionalOwnershipIndex(model, scope, entries) + for plan in plans: + conflict = index.conflict( + root=plan.root, root_key=scope.path_key(plan.root), build_id=plan.build_id, + staging=((target.identity, target.staging) for target in plan.targets), + retiring_root_keys=retiring_root_keys, + ) + if conflict is not None: + accepted = False + metrics["commit_reservations"] = len(entries) + metrics["commit_index_queries"] = index.queries + metrics["commit_fresh_comparisons"] = index.fresh_comparisons + self._inject("before-observation-commit") + scope.seal() + metrics["commit_certificate"] = "verified" + return accepted + finally: + try: + scope.close() + finally: + metrics.update(scope.metrics()) + def _preview_registry_index( self, plans: Sequence[Plan], @@ -1909,7 +2026,18 @@ def _load_recorded_plan( self, state: Path, claim: Mapping[str, Any], *, _filesystem: Any = None ) -> Plan | None: path = state / "plan.json" - if not path.exists(): + if _filesystem is not None and hasattr(_filesystem, "record_exists"): + exists = _filesystem.record_exists(path) + else: + try: + path.lstat() + except FileNotFoundError: + exists = False + except OSError as error: + _fail(f"could not inspect configured output plan {path}: {error}") + else: + exists = True + if not exists: return None plan = Plan.from_payload( _load_json(path, "configured output plan", _filesystem=_filesystem), path, _filesystem=_filesystem @@ -2478,6 +2606,9 @@ def _parse_arguments(arguments: Sequence[str]) -> argparse.Namespace: parser.add_argument( "--experimental-native-observation", action="store_true", help=argparse.SUPPRESS ) + parser.add_argument( + "--experimental-observation-commit", action="store_true", help=argparse.SUPPRESS + ) return parser.parse_args(arguments) @@ -2492,12 +2623,13 @@ def main(arguments: Sequence[str] | None = None) -> int: return 0 if options.lock_root is None: _fail(f"{options.command} requires --lock-root") - if options.experimental_native_observation and options.experimental_registry_index: + if sum((options.experimental_native_observation, options.experimental_registry_index, options.experimental_observation_commit)) > 1: _fail("choose one experimental validation mode") coordinator = OutputCoordinator( options.lock_root, registry_validation=( - "native-shadow" if options.experimental_native_observation + "commit-shadow" if options.experimental_observation_commit + else "native-shadow" if options.experimental_native_observation else "shadow" if options.experimental_registry_index else "reference" ), ) diff --git a/docs/experimental-index-contract.md b/docs/experimental-index-contract.md index 571ff6b..5439b1b 100644 --- a/docs/experimental-index-contract.md +++ b/docs/experimental-index-contract.md @@ -76,3 +76,9 @@ private `native-shadow` mode. It retains reference authority and adds no indexed authorization mode. A real attribute-only reparse conversion disproved ordinary read-handle pinning as a path-lifetime proof. The fresh reader's pilot also failed the performance gate. The original cached-index promotion boundary remains closed. + +The next experiment uses an optimistic read-set commit with exact USN close +witnesses and fresh negative comparisons. Its +[contract and remaining proof boundaries](observation-commit-contract.md) and +[measurements and upgrade evidence](observation-commit-results.md) preserve that +boundary: reference validation remains mandatory and the default is unchanged. diff --git a/docs/observation-commit-contract.md b/docs/observation-commit-contract.md new file mode 100644 index 0000000..20a8b25 --- /dev/null +++ b/docs/observation-commit-contract.md @@ -0,0 +1,193 @@ +# Experimental observation commit + +Status: private `commit-shadow` experiment on +`codex/experimental-generation-engine`. Reference validation remains the only +authority. The default and the CMake consumer commands do not select this mode. + +This replaces the previous fresh-observation experiment's repeated full path +walks with a provisional read set. Its certificate verifies the requested native +object/version witnesses; it is not unconditional namespace authority. The read +set is discarded before the ordinary reference validation and +before any reconciliation mutation. There is no persistent filesystem cache, +new claim format, new lock namespace, watcher, service, or privileged setup. + +## Scope and dependencies + +The caller holds the existing registry, generation, and publication locks in the +existing order. Cooperative coordinators therefore cannot change the ownership +records while they are being authenticated. Each retained claim and recorded +plan is still read and checked against its canonical JSON encoding, record +schema, root key, build identity, plan digest, and projected paths. The index is +an in-memory derivative, never a replacement for authenticating those records. + +The prototype accepts local DOS-drive paths on NTFS with an already active USN +journal and the required ordinary-user handle operations. It does not create or +configure a journal. Unsupported paths, filesystems, access, case-sensitive +directories at initial observation, record formats, API responses, resource +budgets, or changed observations abandon the candidate and run the reference +validator. A missing +capability never requests administrator access or a user configuration change. + +Windows object identity consists of the volume serial and the full 128-bit file +ID. Every positive path component is observed through a short root-relative +native open with `OBJ_DONT_REPARSE`. Only volume-root handles survive a lookup; +ordinary build, staging, registry, and record handles are promptly closed, with +read/write/delete sharing. A competing cleanup can delete an observed directory; +this invalidates the candidate instead of keeping the directory delete-pending +behind a long-lived handle. + +Positive reuse also requires every component's input spelling to exactly match +the canonical native spelling. Case variants, short-name aliases, and other +noncanonical spellings fall back. This is a correctness boundary, not a path +normalization performed on behalf of the caller. + +## Positive read-set argument + +For each unique positive object, the prototype performs these steps: + +1. Obtain its identity and force a USN close record **before** collecting its + type, canonical path, ancestry, or contents. Save the returned USN. +2. Collect provisional facts. Reusing a previously observed object never resets + its starting USN, including when reached through a case alias. +3. Finish all indexed computations, re-enumerate relevant registry inventories, + and recheck DOS-drive and positive name bindings with root-relative opens. +4. Require each reopened object's identity and current USN to match the initial + values. Force a new close record and retain its exact returned USN. +5. Retrieve the **specific** end records. Every requested USN must identify the + expected file and contain exactly `USN_REASON_CLOSE`. Any accumulated reason, + missing record, wrong ID, duplicate witness, unknown version, malformed data, + journal reset, trimming, or bounded-read failure abandons the candidate. + +The end close record matters: equal metadata snapshots alone cannot rule out an +ABA change or pending reasons on a writer opened before observation. Microsoft +documents that a forced close includes current reasons for the file and returns +the USN associated with that operation. The filesystem specification describes +posting a nonzero USN change as advancing the volume sequence and updating the +file's USN. The inference used here is that a relevant NTFS mutation during an +object's observation interval either changes its version or appears among the +forced end record's reasons. The native tests exercise rename, content/timestamp, +and attribute-only reparse ABA changes, including a preexisting writer primed +with the same reason before registration. + +An adversarial native test found a counterexample to treating **all** metadata +as versioned: changing a directory's case-sensitivity flag and changing it back +can leave its USN unchanged and produce a clean end marker. The candidate does +not certify that flag's stability. It rejects initially case-sensitive objects +and rejects noncanonical positive spellings. An exact existing name binds to +the same object in either case mode; changing or removing that object's name +requires a rename/deletion witnessed by its version. Thus the reused geometry +does not depend on a case alias remaining usable. Fresh negative probes still +use the caller's exact spelling. Tests preserve the unjournaled flag +counterexample, test the exact-binding case, and require aliases to fall back. +The case-folded lexical predicate remains the reference validator's conservative +overlap rule; it is not used to resolve a native positive object. +Microsoft describes the lookup behavior under the directory flag in +[per-directory case sensitivity](https://devblogs.microsoft.com/commandline/per-directory-case-sensitivity-and-wsl/). + +This argument covers the anchored NTFS objects. DOS-device mappings are outside +the NTFS journal: reopening each drive at seal checks its final binding, not +whether it was temporarily remapped and restored. Likewise, reading canonical +record bytes under the registry lock retains the reference implementation's +cooperative-writer model; it does not claim an atomic data snapshot against +unsynchronized memory-mapped writers. These namespace and writer boundaries +must be reviewed before a certificate could replace reference validation. No +current certificate bypasses that validation. + +Sources for that inference: + +- [Forced close record and accumulated reasons](https://learn.microsoft.com/en-us/windows/win32/api/winioctl/ni-winioctl-fsctl_write_usn_close_record) +- [Filesystem forced-close operation](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fsa/6b3e0c41-83b4-403e-bdf1-8443eafa8f00) +- [Posting a USN change](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fsa/2c897c5e-b29e-464d-825f-565ff587f7f1) +- [Root-relative object attributes and reparse refusal](https://learn.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_object_attributes) + +The unprivileged journal transport has narrower public documentation than the +ordinary volume read API. On the tested host, directory handles supply journal +epoch queries and unprivileged reads whose names are redacted. The implementation +uses the public V2/V3 record headers and requires positive coverage of every +exact marker. It never treats the absence of an event in this filtered transport +as evidence that nothing changed. A transport that omits a required marker +cannot produce a certificate. This capability and the relevant mutation-to-USN +semantics still require qualification on the supported Windows/NTFS matrix +before any authoritative mode is considered. + +## Missing paths are not indexed as stable + +Creating a child does **not** necessarily advance its parent's USN. A parent +version is therefore insufficient evidence that a previously missing child +remains absent. Missing roots and staging paths stay in a separate partition. +Whenever either side of a directional overlap comparison is missing, its first +missing component is freshly probed relative to the held volume root with +reparse traversal refused. The reverse direction refreshes those observations +again. The final binding sweep checks them once more. A dangling junction is an +existing reparse point, not a successful negative lookup. + +The positive partition uses the independently tested pure ownership index. +Comparisons against the negative partition retain fresh namespace checks; a +negative current endpoint compares against every reservation. Ownership and +same-build retirement exemptions remain the reference rules. This intentionally +retains an O(claims × plans × targets²) negative-check term. A faster sampled +index that assumes all missing paths remain absent would not meet this contract. + +As with the reference validator's successive fresh probes, absence can change +between system calls. This experiment does not claim an atomic snapshot or a +namespace freeze. Its goal is to justify cached **positive** geometry during the +calculations while preserving fresh negative checks. Existing mutation-time +checks remain necessary. A future authoritative design must define the boundary +between a successful past computation and each subsequent mutation explicitly. + +## Expiry, fallback, and operational costs + +Instances are local to one validation phase. Sealing disables further reads; +closing releases roots and clears all observations, locators, inventories, and +object tables. No certificate or path facts cross into claim initialization, +recovery, publication, reset, or the next invocation. A failed or unsupported +commit still runs the ordinary reference validator. A verified candidate +conflict followed by reference acceptance fails closed before reconciliation. + +The experiment posts journal metadata records on observed objects, including +common ancestors. It does not modify their contents or namespace. These posts +are real filesystem work and are included in timing and operation counters. +They can invalidate another observer's saved versions even when neither changed +the geometry. Same-registry operations already serialize through the existing +lock; independent private registries can still collide on common ancestors. +Such collisions conservatively fall back to reference validation. No additional +production mutex was added to conceal this reliability limitation. + +Bounds are 32,768 unique objects, 16 MiB per ownership record, and 64 MiB of +journal transport per volume. Exceeding them falls back. Metrics include native +opens, information queries, negative probes, close posts, version reads, epoch +queries, journal bytes/reads, record seeks/reads, directory enumerations, complete +registry inventories, name-binding checks, and opened/closed handle counts. +Published diagnostics retain no unrelated journal names, claim contents, paths, +or tokens. An exception records its type, not its message. + +## Upgrade contract and promotion gate + +Normal installations continue to use reference validation. Packaging installs +the additional trusted sibling Python helper, without requiring a new consumer +command or runtime dependency. Protocol v1, plan serialization, claim tokens, +lock locations, and recovery/publication formats are unchanged. Old and new +coordinators must be able to alternate, including recovery across crash cuts. + +One independent reference fix inspects a retained `plan.json` with `lstat` and +treats only `FileNotFoundError` as absence. A dangling link is rejected as +malformed state; inaccessible metadata fails validation instead of silently +skipping the record. Valid registries need no migration, reset, regeneration, or +token rotation. Malformed or unreadable recorded state requires its underlying +problem to be repaired rather than being skipped. + +Promotion remains closed until all of the following have evidence: + +- Relevant native mutation semantics and fallback behavior are qualified across + supported configurations; the remaining assumptions above are reviewed. +- Differential, race, malformed-state, crash-recovery, packaging, minimum-Python, + and old/new upgrade checks pass with the final source fingerprints. +- **All validation**, including current plans, every retained record, fresh + negatives, inventories, versions, witnesses, and handle release, reliably stays + below 30 seconds at the target scale and representative layouts/contention. +- A reviewed authoritative integration preserves the mutation-time boundary. + +The read-only candidate benchmark reports that entire candidate cost separately +from its optional reference oracle. It produces no tokens and authorizes no +reconciliation. Ordinary `commit-shadow` timings always include the mandatory +reference pass; candidate timing must never be presented as that full operation. diff --git a/docs/observation-commit-results.json b/docs/observation-commit-results.json new file mode 100644 index 0000000..292fa88 --- /dev/null +++ b/docs/observation-commit-results.json @@ -0,0 +1,1492 @@ +{ + "date": "2026-11-16", + "branch": "codex/experimental-generation-engine", + "starting_commit": "b17dfb7", + "promotion": { + "required_all_validation_seconds": 30, + "reliable_under_30_seconds": false, + "quiet_target_samples_under_30_seconds": true, + "full_target_reference_oracle_agreement": true, + "default": "reference", + "authoritative": "reference", + "index_authorization_enabled": false, + "private_experiment": "commit-shadow", + "certificate_meaning": "exact native object/version close witnesses verified; no permission to bypass reference validation" + }, + "platform": "Windows", + "measurement_python": "3.12.9", + "default_test_python": "3.14.4", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "git_normalized_implementation_files": { + "ProtocyteOutputCoordinator.py": "bb319ff840abaeec63c8bc0caead22499ee0c5de10d459eb08baefd15f43a363", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "source_normalization": { + "difference": "CRLF to LF only", + "files": [ + "ProtocyteOutputCoordinator.py" + ], + "all_four_ast_identical": true + }, + "historical_candidate_scale_profiled": { + "scope": "read-only candidate on a previously seeded private synthetic registry; every record reauthenticated", + "fixture_reused": true, + "fixture_seed_implementation_files": { + "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "f6b9dbf2844bf16fb624f172b5f8e567e3ab0512b1a2971caf3de06453536777" + }, + "fixture_original_setup_wall_seconds": 330.13039900001604, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "samples": [ + { + "repetition": 0, + "scope": "complete read-only committed candidate; no reconciliation authority", + "reference_validation_performed": false, + "reference_result": null, + "reconciliation_authorized": false, + "tokens_produced": 0, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "retained_claims": 2172, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "setup_wall_seconds": 0.0, + "setup_cpu_seconds": 0.0, + "lock_preparation_and_wait_seconds": 0.3152406999724917, + "current_plan_validation_seconds": 0.9323760999832302, + "committed_candidate_wall_seconds": 37.11434189998545, + "committed_candidate_cpu_seconds": 32.546875, + "all_candidate_validation_wall_seconds": 38.0500783000025, + "all_candidate_validation_cpu_seconds": 33.34375, + "reference_oracle_wall_seconds": null, + "reference_oracle_cpu_seconds": null, + "candidate_filesystem_calls": { + "nt.stat": 3 + }, + "index_experiment": { + "mode": "commit-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2172, + "commit_certificate": "verified", + "commit_reservations": 4344, + "commit_index_queries": 22, + "commit_fresh_comparisons": 95568, + "commit_open_calls": 34824, + "commit_info_calls": 67473, + "commit_negative_probes": 412812, + "commit_close_posts": 21768, + "commit_version_reads": 15228, + "commit_epoch_queries": 3, + "commit_journal_reads": 1, + "commit_journal_bytes": 873928, + "commit_witnesses": 10884, + "commit_records_read": 4344, + "commit_binding_checks": 15249, + "commit_record_read_calls": 8688, + "commit_record_seek_calls": 4344, + "commit_directory_enumerations": 8706, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 30458, + "commit_handles_closed": 30458, + "commit_final_path_calls": 10884 + }, + "cprofile_enabled": true + }, + { + "repetition": 1, + "scope": "complete read-only committed candidate; no reconciliation authority", + "reference_validation_performed": false, + "reference_result": null, + "reconciliation_authorized": false, + "tokens_produced": 0, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "retained_claims": 2172, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "setup_wall_seconds": 0.0, + "setup_cpu_seconds": 0.0, + "lock_preparation_and_wait_seconds": 0.39175289997365326, + "current_plan_validation_seconds": 1.0265710999956354, + "committed_candidate_wall_seconds": 39.178787200013176, + "committed_candidate_cpu_seconds": 34.015625, + "all_candidate_validation_wall_seconds": 40.20758329995442, + "all_candidate_validation_cpu_seconds": 34.84375, + "reference_oracle_wall_seconds": null, + "reference_oracle_cpu_seconds": null, + "candidate_filesystem_calls": {}, + "index_experiment": { + "mode": "commit-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2172, + "commit_certificate": "verified", + "commit_reservations": 4344, + "commit_index_queries": 22, + "commit_fresh_comparisons": 95568, + "commit_open_calls": 34824, + "commit_info_calls": 67473, + "commit_negative_probes": 412812, + "commit_close_posts": 21768, + "commit_version_reads": 15228, + "commit_epoch_queries": 3, + "commit_journal_reads": 1, + "commit_journal_bytes": 873288, + "commit_witnesses": 10884, + "commit_records_read": 4344, + "commit_binding_checks": 15249, + "commit_record_read_calls": 8688, + "commit_record_seek_calls": 4344, + "commit_directory_enumerations": 8706, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 30458, + "commit_handles_closed": 30458, + "commit_final_path_calls": 10884 + }, + "cprofile_enabled": true + }, + { + "repetition": 2, + "scope": "complete read-only committed candidate; no reconciliation authority", + "reference_validation_performed": false, + "reference_result": null, + "reconciliation_authorized": false, + "tokens_produced": 0, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "retained_claims": 2172, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "setup_wall_seconds": 0.0, + "setup_cpu_seconds": 0.0, + "lock_preparation_and_wait_seconds": 0.3528101000119932, + "current_plan_validation_seconds": 0.9122066999552771, + "committed_candidate_wall_seconds": 34.563924699963536, + "committed_candidate_cpu_seconds": 30.953125, + "all_candidate_validation_wall_seconds": 35.47807960002683, + "all_candidate_validation_cpu_seconds": 31.765625, + "reference_oracle_wall_seconds": null, + "reference_oracle_cpu_seconds": null, + "candidate_filesystem_calls": {}, + "index_experiment": { + "mode": "commit-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2172, + "commit_certificate": "verified", + "commit_reservations": 4344, + "commit_index_queries": 22, + "commit_fresh_comparisons": 95568, + "commit_open_calls": 34824, + "commit_info_calls": 67473, + "commit_negative_probes": 412812, + "commit_close_posts": 21768, + "commit_version_reads": 15228, + "commit_epoch_queries": 3, + "commit_journal_reads": 1, + "commit_journal_bytes": 872328, + "commit_witnesses": 10884, + "commit_records_read": 4344, + "commit_binding_checks": 15249, + "commit_record_read_calls": 8688, + "commit_record_seek_calls": 4344, + "commit_directory_enumerations": 8706, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 30458, + "commit_handles_closed": 30458, + "commit_final_path_calls": 10884 + }, + "cprofile_enabled": true + } + ], + "matches_final_implementation": false, + "historical_reason": "before final reference metadata-error correction; native observation helper unchanged" + }, + "historical_candidate_scale_timer_only": { + "scope": "read-only candidate on a previously seeded private synthetic registry; every record reauthenticated", + "fixture_reused": true, + "fixture_seed_implementation_files": { + "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "f6b9dbf2844bf16fb624f172b5f8e567e3ab0512b1a2971caf3de06453536777" + }, + "fixture_original_setup_wall_seconds": 330.13039900001604, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "samples": [ + { + "repetition": 0, + "scope": "complete read-only committed candidate; no reconciliation authority", + "cprofile_enabled": false, + "reference_validation_performed": false, + "reference_result": null, + "reconciliation_authorized": false, + "tokens_produced": 0, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "retained_claims": 2172, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "setup_wall_seconds": 0.0, + "setup_cpu_seconds": 0.0, + "lock_preparation_and_wait_seconds": 0.6369367000297643, + "current_plan_validation_seconds": 1.8816780000342987, + "committed_candidate_wall_seconds": 43.777817099995445, + "committed_candidate_cpu_seconds": 32.515625, + "all_candidate_validation_wall_seconds": 45.65951369999675, + "all_candidate_validation_cpu_seconds": 33.984375, + "reference_oracle_wall_seconds": null, + "reference_oracle_cpu_seconds": null, + "candidate_filesystem_calls": null, + "index_experiment": { + "mode": "commit-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2172, + "commit_certificate": "verified", + "commit_reservations": 4344, + "commit_index_queries": 22, + "commit_fresh_comparisons": 95568, + "commit_open_calls": 34824, + "commit_info_calls": 67473, + "commit_negative_probes": 412812, + "commit_close_posts": 21768, + "commit_version_reads": 15228, + "commit_epoch_queries": 3, + "commit_journal_reads": 1, + "commit_journal_bytes": 873368, + "commit_witnesses": 10884, + "commit_records_read": 4344, + "commit_binding_checks": 15249, + "commit_record_read_calls": 8688, + "commit_record_seek_calls": 4344, + "commit_directory_enumerations": 8706, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 30458, + "commit_handles_closed": 30458, + "commit_final_path_calls": 10884 + } + }, + { + "repetition": 1, + "scope": "complete read-only committed candidate; no reconciliation authority", + "cprofile_enabled": false, + "reference_validation_performed": false, + "reference_result": null, + "reconciliation_authorized": false, + "tokens_produced": 0, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "retained_claims": 2172, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "setup_wall_seconds": 0.0, + "setup_cpu_seconds": 0.0, + "lock_preparation_and_wait_seconds": 0.3997910999460146, + "current_plan_validation_seconds": 1.2419860000372864, + "committed_candidate_wall_seconds": 54.65512499999022, + "committed_candidate_cpu_seconds": 39.828125, + "all_candidate_validation_wall_seconds": 55.897128199983854, + "all_candidate_validation_cpu_seconds": 40.78125, + "reference_oracle_wall_seconds": null, + "reference_oracle_cpu_seconds": null, + "candidate_filesystem_calls": null, + "index_experiment": { + "mode": "commit-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2172, + "commit_certificate": "verified", + "commit_reservations": 4344, + "commit_index_queries": 22, + "commit_fresh_comparisons": 95568, + "commit_open_calls": 34824, + "commit_info_calls": 67473, + "commit_negative_probes": 412812, + "commit_close_posts": 21768, + "commit_version_reads": 15228, + "commit_epoch_queries": 3, + "commit_journal_reads": 1, + "commit_journal_bytes": 873288, + "commit_witnesses": 10884, + "commit_records_read": 4344, + "commit_binding_checks": 15249, + "commit_record_read_calls": 8688, + "commit_record_seek_calls": 4344, + "commit_directory_enumerations": 8706, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 30458, + "commit_handles_closed": 30458, + "commit_final_path_calls": 10884 + } + }, + { + "repetition": 2, + "scope": "complete read-only committed candidate; no reconciliation authority", + "cprofile_enabled": false, + "reference_validation_performed": false, + "reference_result": null, + "reconciliation_authorized": false, + "tokens_produced": 0, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "retained_claims": 2172, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "setup_wall_seconds": 0.0, + "setup_cpu_seconds": 0.0, + "lock_preparation_and_wait_seconds": 0.5346634000306949, + "current_plan_validation_seconds": 1.7342174000223167, + "committed_candidate_wall_seconds": 79.99075850000372, + "committed_candidate_cpu_seconds": 56.078125, + "all_candidate_validation_wall_seconds": 81.72499359998619, + "all_candidate_validation_cpu_seconds": 57.28125, + "reference_oracle_wall_seconds": null, + "reference_oracle_cpu_seconds": null, + "candidate_filesystem_calls": null, + "index_experiment": { + "mode": "commit-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2172, + "commit_certificate": "verified", + "commit_reservations": 4344, + "commit_index_queries": 22, + "commit_fresh_comparisons": 95568, + "commit_open_calls": 34824, + "commit_info_calls": 67473, + "commit_negative_probes": 412812, + "commit_close_posts": 21768, + "commit_version_reads": 15228, + "commit_epoch_queries": 3, + "commit_journal_reads": 1, + "commit_journal_bytes": 872248, + "commit_witnesses": 10884, + "commit_records_read": 4344, + "commit_binding_checks": 15249, + "commit_record_read_calls": 8688, + "commit_record_seek_calls": 4344, + "commit_directory_enumerations": 8706, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 30458, + "commit_handles_closed": 30458, + "commit_final_path_calls": 10884 + } + } + ], + "matches_final_implementation": false, + "historical_reason": "before final reference metadata-error correction; native observation helper unchanged" + }, + "candidate_scale_timer_only": { + "scope": "read-only candidate on a previously seeded private synthetic registry; every record reauthenticated", + "fixture_reused": true, + "fixture_seed_implementation_files": { + "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "f6b9dbf2844bf16fb624f172b5f8e567e3ab0512b1a2971caf3de06453536777" + }, + "fixture_original_setup_wall_seconds": 330.13039900001604, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "samples": [ + { + "repetition": 0, + "scope": "complete read-only committed candidate; no reconciliation authority", + "cprofile_enabled": false, + "reference_validation_performed": false, + "reference_result": null, + "reconciliation_authorized": false, + "tokens_produced": 0, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "retained_claims": 2172, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "setup_wall_seconds": 0.0, + "setup_cpu_seconds": 0.0, + "lock_preparation_and_wait_seconds": 0.1702563000144437, + "current_plan_validation_seconds": 0.5166338999988511, + "committed_candidate_wall_seconds": 24.800610000034794, + "committed_candidate_cpu_seconds": 21.75, + "all_candidate_validation_wall_seconds": 25.31726109998999, + "all_candidate_validation_cpu_seconds": 22.25, + "reference_oracle_wall_seconds": null, + "reference_oracle_cpu_seconds": null, + "candidate_filesystem_calls": null, + "index_experiment": { + "mode": "commit-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2172, + "commit_certificate": "verified", + "commit_reservations": 4344, + "commit_index_queries": 22, + "commit_fresh_comparisons": 95568, + "commit_open_calls": 34824, + "commit_info_calls": 67473, + "commit_negative_probes": 412812, + "commit_close_posts": 21768, + "commit_version_reads": 15228, + "commit_epoch_queries": 3, + "commit_journal_reads": 1, + "commit_journal_bytes": 872008, + "commit_witnesses": 10884, + "commit_records_read": 4344, + "commit_binding_checks": 15249, + "commit_record_read_calls": 8688, + "commit_record_seek_calls": 4344, + "commit_directory_enumerations": 8706, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 30458, + "commit_handles_closed": 30458, + "commit_final_path_calls": 10884 + } + }, + { + "repetition": 1, + "scope": "complete read-only committed candidate; no reconciliation authority", + "cprofile_enabled": false, + "reference_validation_performed": false, + "reference_result": null, + "reconciliation_authorized": false, + "tokens_produced": 0, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "retained_claims": 2172, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "setup_wall_seconds": 0.0, + "setup_cpu_seconds": 0.0, + "lock_preparation_and_wait_seconds": 0.2692875000066124, + "current_plan_validation_seconds": 0.47470429999521, + "committed_candidate_wall_seconds": 19.509043800004292, + "committed_candidate_cpu_seconds": 18.578125, + "all_candidate_validation_wall_seconds": 19.98376149998512, + "all_candidate_validation_cpu_seconds": 19.0625, + "reference_oracle_wall_seconds": null, + "reference_oracle_cpu_seconds": null, + "candidate_filesystem_calls": null, + "index_experiment": { + "mode": "commit-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2172, + "commit_certificate": "verified", + "commit_reservations": 4344, + "commit_index_queries": 22, + "commit_fresh_comparisons": 95568, + "commit_open_calls": 34824, + "commit_info_calls": 67473, + "commit_negative_probes": 412812, + "commit_close_posts": 21768, + "commit_version_reads": 15228, + "commit_epoch_queries": 3, + "commit_journal_reads": 1, + "commit_journal_bytes": 872808, + "commit_witnesses": 10884, + "commit_records_read": 4344, + "commit_binding_checks": 15249, + "commit_record_read_calls": 8688, + "commit_record_seek_calls": 4344, + "commit_directory_enumerations": 8706, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 30458, + "commit_handles_closed": 30458, + "commit_final_path_calls": 10884 + } + }, + { + "repetition": 2, + "scope": "complete read-only committed candidate; no reconciliation authority", + "cprofile_enabled": false, + "reference_validation_performed": false, + "reference_result": null, + "reconciliation_authorized": false, + "tokens_produced": 0, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "retained_claims": 2172, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "setup_wall_seconds": 0.0, + "setup_cpu_seconds": 0.0, + "lock_preparation_and_wait_seconds": 0.19897550001041964, + "current_plan_validation_seconds": 0.48461739998310804, + "committed_candidate_wall_seconds": 18.090615799999796, + "committed_candidate_cpu_seconds": 17.75, + "all_candidate_validation_wall_seconds": 18.575247299973853, + "all_candidate_validation_cpu_seconds": 18.25, + "reference_oracle_wall_seconds": null, + "reference_oracle_cpu_seconds": null, + "candidate_filesystem_calls": null, + "index_experiment": { + "mode": "commit-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2172, + "commit_certificate": "verified", + "commit_reservations": 4344, + "commit_index_queries": 22, + "commit_fresh_comparisons": 95568, + "commit_open_calls": 34824, + "commit_info_calls": 67473, + "commit_negative_probes": 412812, + "commit_close_posts": 21768, + "commit_version_reads": 15228, + "commit_epoch_queries": 3, + "commit_journal_reads": 1, + "commit_journal_bytes": 871448, + "commit_witnesses": 10884, + "commit_records_read": 4344, + "commit_binding_checks": 15249, + "commit_record_read_calls": 8688, + "commit_record_seek_calls": 4344, + "commit_directory_enumerations": 8706, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 30458, + "commit_handles_closed": 30458, + "commit_final_path_calls": 10884 + } + } + ], + "matches_final_implementation": true + }, + "target_scale_reference_oracle": { + "scope": "read-only candidate on a previously seeded private synthetic registry; every record reauthenticated", + "fixture_reused": true, + "fixture_seed_implementation_files": { + "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "f6b9dbf2844bf16fb624f172b5f8e567e3ab0512b1a2971caf3de06453536777" + }, + "fixture_original_setup_wall_seconds": 330.13039900001604, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "samples": [ + { + "repetition": 0, + "scope": "complete read-only committed candidate; no reconciliation authority", + "cprofile_enabled": false, + "reference_validation_performed": true, + "reference_result": "accepted", + "reconciliation_authorized": false, + "tokens_produced": 0, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "retained_claims": 2172, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "setup_wall_seconds": 0.0, + "setup_cpu_seconds": 0.0, + "lock_preparation_and_wait_seconds": 0.1652985999826342, + "current_plan_validation_seconds": 0.5084627000032924, + "committed_candidate_wall_seconds": 21.547852299991064, + "committed_candidate_cpu_seconds": 20.609375, + "all_candidate_validation_wall_seconds": 22.056334599968977, + "all_candidate_validation_cpu_seconds": 21.078125, + "reference_oracle_wall_seconds": 310.0432202999946, + "reference_oracle_cpu_seconds": 290.171875, + "candidate_filesystem_calls": null, + "index_experiment": { + "mode": "commit-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2172, + "commit_certificate": "verified", + "commit_reservations": 4344, + "commit_index_queries": 22, + "commit_fresh_comparisons": 95568, + "commit_open_calls": 34824, + "commit_info_calls": 67473, + "commit_negative_probes": 412812, + "commit_close_posts": 21768, + "commit_version_reads": 15228, + "commit_epoch_queries": 3, + "commit_journal_reads": 1, + "commit_journal_bytes": 872488, + "commit_witnesses": 10884, + "commit_records_read": 4344, + "commit_binding_checks": 15249, + "commit_record_read_calls": 8688, + "commit_record_seek_calls": 4344, + "commit_directory_enumerations": 8706, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 30458, + "commit_handles_closed": 30458, + "commit_final_path_calls": 10884 + } + } + ], + "matches_final_implementation": true, + "agreement": true + }, + "full_shadow_samples": [ + { + "matches_final_implementation": true, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "revision": "candidate", + "repetition": 0, + "retained_claims": 64, + "current_plans": 11, + "layout": { + "targets_per_plan": 1, + "shared_build_root": false, + "existing_directories": false + }, + "seed_wall_seconds": 5.577846300031524, + "seed_cpu_seconds": 4.203125, + "validation_wall_seconds": 10.906187899992801, + "validation_cpu_seconds": 10.71875, + "reconcile_wall_seconds": 12.30889039998874, + "reconcile_cpu_seconds": 11.890625, + "lock_wait_wall_seconds": 0.20890930009773, + "registry_lock_held_wall_seconds": 12.290944800013676, + "current_plan_validation_wall_seconds": 0.5120710000046529, + "validation_engine": "commit-shadow", + "python_registry_scans": 1, + "native_registry_inventory_scans": 2, + "index_experiment": { + "mode": "commit-shadow", + "authoritative": "reference", + "preview_wall_seconds": 0.7804933000006713, + "reference_wall_seconds": 10.124300299969036, + "agreement": true, + "commit_claims_checked": 64, + "commit_certificate": "verified", + "commit_reservations": 128, + "commit_index_queries": 22, + "commit_fresh_comparisons": 2816, + "commit_open_calls": 1098, + "commit_info_calls": 2116, + "commit_negative_probes": 12292, + "commit_close_posts": 690, + "commit_version_reads": 473, + "commit_epoch_queries": 3, + "commit_journal_reads": 1, + "commit_journal_bytes": 27608, + "commit_witnesses": 345, + "commit_records_read": 128, + "commit_binding_checks": 494, + "commit_record_read_calls": 256, + "commit_record_seek_calls": 128, + "commit_directory_enumerations": 260, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 948, + "commit_handles_closed": 948, + "commit_final_path_calls": 345, + "preview_result": "accepted", + "reference_result": "accepted" + }, + "shadow_candidate_wall_seconds": 0.7804933000006713, + "reference_validation_wall_seconds": 10.124300299969036, + "registry_validations": 1, + "registry_scans": 3, + "recorded_plan_loads_in_validation": 128, + "path_projections_in_validation": 7621, + "path_projections_total": 8655, + "validation_filesystem_calls": { + "nt.stat": 174473, + "nt.lstat": 14664, + "nt._getfinalpathname": 15242 + }, + "completed_plans": 11 + }, + { + "matches_final_implementation": true, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "revision": "candidate", + "repetition": 0, + "retained_claims": 8, + "current_plans": 11, + "layout": { + "targets_per_plan": 3, + "shared_build_root": true, + "existing_directories": true + }, + "seed_wall_seconds": 1.6359737000311725, + "seed_cpu_seconds": 1.25, + "validation_wall_seconds": 4.962917600001674, + "validation_cpu_seconds": 4.734375, + "reconcile_wall_seconds": 8.172802199958824, + "reconcile_cpu_seconds": 7.671875, + "lock_wait_wall_seconds": 0.24166279996279627, + "registry_lock_held_wall_seconds": 8.135796799964737, + "current_plan_validation_wall_seconds": 2.2325147000374272, + "validation_engine": "commit-shadow", + "python_registry_scans": 1, + "native_registry_inventory_scans": 2, + "index_experiment": { + "mode": "commit-shadow", + "authoritative": "reference", + "preview_wall_seconds": 0.1537623000331223, + "reference_wall_seconds": 4.808976600004826, + "agreement": true, + "commit_claims_checked": 8, + "commit_certificate": "verified", + "commit_reservations": 32, + "commit_index_queries": 44, + "commit_fresh_comparisons": 0, + "commit_open_calls": 302, + "commit_info_calls": 725, + "commit_negative_probes": 0, + "commit_close_posts": 268, + "commit_version_reads": 150, + "commit_epoch_queries": 3, + "commit_journal_reads": 1, + "commit_journal_bytes": 10728, + "commit_witnesses": 134, + "commit_records_read": 16, + "commit_binding_checks": 133, + "commit_record_read_calls": 32, + "commit_record_seek_calls": 16, + "commit_directory_enumerations": 36, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 302, + "commit_handles_closed": 302, + "commit_final_path_calls": 134, + "preview_result": "accepted", + "reference_result": "accepted" + }, + "shadow_candidate_wall_seconds": 0.1537623000331223, + "reference_validation_wall_seconds": 4.808976600004826, + "registry_validations": 1, + "registry_scans": 3, + "recorded_plan_loads_in_validation": 16, + "path_projections_in_validation": 3333, + "path_projections_total": 5775, + "validation_filesystem_calls": { + "nt.stat": 82032, + "nt.lstat": 3334, + "nt._getfinalpathname": 6666 + }, + "completed_plans": 11 + } + ], + "rejected_parent_lease_batch": { + "matches_final_implementation": false, + "retained_claims": 2172, + "current_plans": 11, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "db4bf01e660477616cc0c9da2847dbaa7adc2791aeae00064b00bf1ce80296f6" + }, + "all_candidate_validation_wall_seconds": 46.83222300000489, + "index_experiment": { + "mode": "commit-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2172, + "commit_certificate": "verified", + "commit_reservations": 4344, + "commit_index_queries": 22, + "commit_fresh_comparisons": 95568, + "commit_open_calls": 85600, + "commit_info_calls": 118249, + "commit_negative_probes": 412812, + "commit_close_posts": 21768, + "commit_version_reads": 15228, + "commit_epoch_queries": 3, + "commit_journal_reads": 1, + "commit_journal_bytes": 873448, + "commit_witnesses": 10884, + "commit_records_read": 4344, + "commit_binding_checks": 15249, + "commit_record_read_calls": 8688, + "commit_record_seek_calls": 4344, + "commit_directory_enumerations": 8706, + "commit_full_inventory_scans": 2, + "commit_comparison_batches": 2992, + "commit_peak_parent_leases": 17, + "commit_relative_negative_probes": 382272, + "commit_state": "closed", + "commit_handles_opened": 81234, + "commit_handles_closed": 81234, + "commit_final_path_calls": 10884 + }, + "retained_in_code": false, + "reason": "extra opens and request construction increased total cost without reducing negative query cost" + }, + "qualification": { + "default_suite": { + "passed": 1834, + "skipped": 41, + "wall_seconds": 78.72 + }, + "commit_shadow_coordinator_suite": { + "passed": 89, + "skipped": 6, + "wall_seconds": 33.36 + }, + "minimum_python_3_12_observation_and_ownership": { + "passed": 109, + "skipped": 0, + "wall_seconds": 7.0 + }, + "cmake_integration": { + "passed": 19, + "skipped": 1, + "wall_seconds": 89.28 + }, + "upgrade_and_rollback": { + "scope": "isolated Windows cross-version checks; no consumer registry accessed", + "legacy_git_blob": "25f1660190d3d1015fef3955814c8c737bd686c5", + "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", + "candidate_coordinator_sha256": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "candidate_helper_sha256": { + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "unchanged_ast_methods_since_checkpoint": [ + "reconcile_set", + "_reconcile_locked", + "validate", + "publish", + "reset", + "_recover", + "_apply_pending", + "_publish_one", + "_initialize_claim_locked", + "_release_claim", + "_generation_lock", + "_publication_lock" + ], + "reference_validator_ast_unchanged_since_checkpoint": false, + "file_lock_ast_unchanged_since_checkpoint": true, + "passed_cases": 71, + "cases": [ + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "reference", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "reference", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "shadow", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "native-shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "native-shadow", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "commit-shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "commit-shadow", + "reader": "old", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + } + ] + } + }, + "notes": [ + "Candidate-only samples reauthenticate every real claim and plan in a previously seeded private registry; no current claims, tokens, or outputs are produced.", + "Current-plan validation, all candidate checks, close witnesses and handle release are included; setup and lock wait are reported separately.", + "Current plans are parsed during fixture preparation, as in the reconcile API benchmark; CLI plan parsing is outside these validation phase timings.", + "The fresh fixture was seeded once; repeated read sets do not imply a cold OS cache. Profiler and timer-only runs occurred separately on a workstation with variable timings.", + "As-run fingerprints retain Windows working-file bytes; Git-normalized fingerprints are recorded separately after verifying only CRLF-to-LF differences and identical ASTs for all four helpers.", + "Native calls are reported explicitly; cProfile's Python stat count alone is not total filesystem work. Full shadow registry_scans includes two native inventories plus the reference scan.", + "Initially case-sensitive directories and noncanonical positive spellings fall back; case-mode changes alone need not change NTFS USNs.", + "Independent observers' close markers can invalidate common ancestor versions and cause conservative reference fallback.", + "Unsupported capability, access, format, changed observations, resource limits, or unknown errors grant no indexed authority.", + "The NTFS object argument does not certify DOS-device mapping lifetime or an atomic snapshot against unsynchronized memory-mapped record writers.", + "Protocol v1, lock namespace, tokens, and recovery/publication formats are preserved. Dangling retained plan links and inaccessible record metadata now fail validation instead of being silently skipped." + ] +} diff --git a/docs/observation-commit-results.md b/docs/observation-commit-results.md new file mode 100644 index 0000000..2360b9f --- /dev/null +++ b/docs/observation-commit-results.md @@ -0,0 +1,200 @@ +# Observation commit experiment: results + +The index remains **disabled as an authority** on +`codex/experimental-generation-engine`. The new read-set experiment has a safe +shadow integration, useful native evidence, and passing upgrade checks. It has +not met the requirement for reliable full validation below 30 seconds. + +The default is still reference validation. There is no index-only command or +automatic promotion. The private `--experimental-observation-commit` switch runs +the candidate and then mandatory reference validation before reconciliation. +Unsupported capabilities, changed observations, and candidate failures fall +back to reference. A verified candidate conflict that reference accepts fails +closed before claim initialization. + +## What changed + +[ProtocyteObservationCommit.py](../cmake/ProtocyteObservationCommit.py) implements +one bounded optimistic read set. It collects positive geometry after a forced +USN close marker, authenticates every retained claim and plan, and checks final +identities and versions against exact close-record witnesses. Missing witnesses, +dirty reasons, unknown formats, changed epochs, and bounded-read failures cannot +certify a candidate. The unprivileged journal stream is used to retrieve specific +positive witnesses; missing events are never interpreted as proof of stability. + +Only volume-root handles remain open between lookups. Ordinary directories and +record files use short opens, so deleting and recreating an observed build +directory is possible and invalidates the candidate. Observations expire before +reference validation, claim initialization, recovery, and output mutations. The +normal lock order and lock namespace remain unchanged. + +Missing paths are deliberately excluded from the stable index partition. Every +directional overlap comparison refreshes its missing endpoints, and seal checks +them again. This preserves the expensive term in missing-directory layouts. + +The [contract](observation-commit-contract.md) gives the consistency argument, +primary API sources, supported capabilities, costs, and remaining proof +boundaries. The certificate verifies its requested native witnesses; it is not +an unconditional filesystem snapshot or permission to skip reference validation. + +## Measured target scale + +The synthetic registry contains **2,172 real retained claims and 11 current +plans**, with one target per plan and missing output/staging directories. +Measurements use CPython 3.12.9 on Windows. Each run authenticates all **4,344 +ownership records** and includes current-plan validation, the complete candidate, +final inventories, versions, close witnesses, and handle release. + +| Measurement | Run 1 | Run 2 | Run 3 | +| --- | ---: | ---: | ---: | +| Final-source full candidate validation, wall/CPU timers without cProfile | 25.317 s | 19.984 s | 18.575 s | +| Earlier snapshot, with cProfile | 38.050 s | 40.208 s | 35.478 s | +| Earlier snapshot, wall/CPU timers without cProfile | 45.660 s | 55.897 s | 81.725 s | + +All three final-source quiet samples pass 30 seconds. They establish feasibility +for this reused synthetic layout, not reliable performance across configurations +and contention. The six earlier samples precede the final reference +metadata-error correction; the native observation helper is byte-identical. +They retain their own source fingerprints and are explicitly historical in the +report. The large timing spread remains a reason to keep the promotion gate +closed. These are separate workstation runs, not controlled comparisons of +profiler overhead. Timer-only runs retain every validation check and counter. + +Each candidate run performed **95,568 fresh reservation comparisons**, **412,812 +negative probes**, **21,768 forced close posts**, and verified **10,884 exact +end witnesses**. It performed two complete registry inventories, plus per-state +enumerations, and balanced all **30,458 opened and closed handles**. Native +information, file-read, seek, final-path, epoch, and journal calls are also +reported. Python's small `stat` count must not be presented as total filesystem +work. + +The registry was seeded once in a fresh private fixture, taking 330.130 seconds. +The three final-source samples reuse that fixture, create new read sets, and +reauthenticate every record each time. Setup and lock wait are reported +separately. A reused fixture or new process does not imply a cold OS cache. +The synthetic dimensions match the reported consumer case; its contents and +layout are synthetic. No consumer registry was accessed. + +These large runs are read-only candidate measurements: they produce no current +claim, token, reconciliation, or publication. They do not include a subsequent +reference pass and are not timings of the currently authorized reconciler. +As in the API benchmark, current plan files are parsed during fixture +preparation; CLI plan parsing is outside these validation phase timings. + +Final-source full shadow samples retain reference and reconciliation costs: + +| Layout (11 current plans) | Candidate registry phase | Reference registry phase | Current-plan set check | Entire reconcile call | +| --- | ---: | ---: | ---: | ---: | +| 64 claims, one target, missing directories | 0.780 s | 10.124 s | 0.512 s | 12.309 s | +| 8 claims, three targets, existing directories, shared build root | 0.154 s | 4.809 s | 2.233 s | 8.173 s | + +Both phases accepted in each sample, verified every required witness, and +balanced all handles. Each full sample counted **three** registry inventory +scans: two native candidate inventories and one reference scan. Per-state +enumerations are additional work. The complete counts and fingerprints are in +[the path-free report](observation-commit-results.json). + +A fourth final-source target-scale run also executed the complete fresh +reference oracle on the same **2,172/11** fixture. The full read-only candidate +took **22.056 seconds**; the separate reference registry pass took **310.043 +seconds**. Both accepted, all witnesses verified, and the fixture retained its +original 2,172 claims. No current tokens or reconciliation were produced. This +is agreement evidence and a phase comparison, not an enabled production speedup. + +## Counterexamples and rejected optimization + +- Parent-directory USNs do not reliably change when a missing child is created. + Parent versions therefore cannot justify cached absence. Native tests cover + creation after observation and changes between the two comparison directions. +- Case-mode changes can leave the directory USN unchanged, even after an ABA + toggle. Positive reuse now requires exact canonical spelling; aliases fall + back instead of assuming their continued usability. Tests retain this + counterexample and exercise exact bindings in both end modes. +- A writer opened before registration can repeat attribute-only reparse changes + and restore the original directory. Forced-close/version tests reject this, + including a writer primed with the same reason before the observation began. +- Holding ordinary directory handles for the whole operation obstructs cleanup. + The retained implementation closes them promptly and tests delete/recreate. +- A bounded parent-handle batching variant kept fresh probes, but added opens + and request construction without lowering negative-query cost. Its first + profiled target-scale validation took **46.832 seconds**. It was removed; the + report identifies its different source fingerprint and rejected status. + +The retained version's profile spends most of its time in negative namespace +queries. Further progress needs a proven way to avoid repeated missing-path +checks. The unprivileged journal's filtered, redacted stream is not proof that +all relevant namespace changes were absent. + +## Upgrade and regression evidence + +- Default suite on Python 3.14.4: **1,834 passed, 41 skipped**. +- Existing coordinator suite through commit-shadow: **89 passed, 6 skipped**. +- Observation/index and metadata-error tests on minimum Python 3.12: + **109 passed**, no skips. +- CMake/installed relocation checks: **19 passed, 1 skipped**. All three private + modes work after relocating the package, leave its files unchanged, and write + no bytecode caches into the prefix. +- Offline upgrade/rollback qualification: **71 passed cases** against the exact + public protocol-v1 source blob `25f1660190d3d1015fef3955814c8c737bd686c5`, also + present at commit `72fc9087f6d7fd1c133aaf33903df8ca1585fe69`. Its SHA-256 is + `2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85`. + +Upgrade cases alternate old/new coordinators, preserve existing claim bytes, +tokens and no-op output timestamps, publish in both directions, and recover +across four publication, two initialization, and three reset crash cuts. The +harness also verifies twelve mutation/lock methods and `FileLock` remain AST +identical to preservation checkpoint `f804fd1`. The reference-validator AST is +not identical: observation adapters and explicit validation fixes are recorded +rather than claiming the whole implementation is unchanged. + +Normal consumers need no new configuration, dependency, privilege, migration, +reset, or token rotation. Protocol v1, plan encoding, publication and recovery +formats remain compatible. The helper is installed through existing CMake +packaging; generated C++ and runtime ABI are untouched. + +One reference fix intentionally rejects a dangling retained `plan.json` link, +which was previously skipped as if no recorded plan existed. It uses `lstat` +and treats only `FileNotFoundError` as absence: inaccessible metadata must also +fail validation. Regression tests prove rejection before a new claim is +initialized and preservation of the existing token. Valid registries retain +their existing behavior; malformed or unreadable state must be repaired. + +## Remaining promotion blockers + +Sub-30-second validation is demonstrated in three quiet one-target samples; +reliability across fresh layouts and contention is unqualified. More targets +multiply the fresh negative comparisons. Independent read +sets can also invalidate each other's common-ancestor versions with their own +close markers, causing a conservative reference fallback. The experiment adds +real journal metadata writes and does not remove the existing locks. + +The native argument still needs qualification across supported Windows/NTFS +configurations. DOS-device mapping lifetime and unsynchronized record writers +are explicit boundaries in the contract, and no atomic namespace freeze is +claimed. Existing mutation-time checks remain necessary. An authoritative +integration requires separate review of those boundaries even if future +candidate timings improve. + +## Reproduction + +Run from a checkout with Python 3.12+; fixture/result directories must be new: + +```text +python tests/benchmark_observation_commit.py --claims 2172 --plans 11 --large --repeat 3 --work NEW_PRIVATE_DIRECTORY +python tests/benchmark_observation_commit.py --claims 2172 --plans 11 --large --repeat 3 --no-profile --work ANOTHER_NEW_PRIVATE_DIRECTORY +python tests/benchmark_output_registry.py --registry-validation commit-shadow --claims 64 --plans 11 --repeat 1 --work NEW_SHADOW_DIRECTORY +python tests/verify_coordinator_upgrade.py --work NEW_UPGRADE_DIRECTORY +``` + +The public candidate tool seeds fresh fixtures per sample; the target-scale +measurements above used an explicitly reported reused fixture to avoid repeated setup. +Use `--reference-oracle` to time a separate fresh reference pass in the read-only +candidate tool. It still produces no current tokens or reconciliation. +Upgrade qualification requires the pinned source blob and checkpoint in local +Git history. Fixture directories, profiles, logs, claims, and tokens remain +private; share only the sanitized result JSON. Source-drift guards reject +measurements or qualification if the implementation changes during the run. + +The report keeps the as-run source hashes and Git-normalized hashes separately. +Git changes only the coordinator's CRLF line endings to LF; byte normalization +and AST comparisons verify identical code for all four implementation files. diff --git a/tests/benchmark_observation_commit.py b/tests/benchmark_observation_commit.py new file mode 100644 index 0000000..446ccd7 --- /dev/null +++ b/tests/benchmark_observation_commit.py @@ -0,0 +1,183 @@ +"""Read-only committed candidate benchmark; never reconciliation authority. + +Seeds real claims in a new private registry, takes the ordinary coordinator +locks, validates all current plans and runs the entire provisional read-set +commit (record authentication, comparisons, inventories, versions, witnesses, +and handle release). No tokens, claims, or outputs are produced after seeding. +The optional reference oracle is timed separately. Even a verified native +certificate does not make this experimental algorithm an authorized validator. +Only results.json is suitable for sharing; fixtures contain private paths. +""" + +from __future__ import annotations + +import argparse +import cProfile +import contextlib +import json +import platform +import tempfile +import time +from pathlib import Path + +from benchmark_output_registry import ( + _filesystem_counts, + _implementation_fingerprint, + _load, + _prepare_fixture, +) + + +def sample(module, work: Path, args) -> dict: + expected = _implementation_fingerprint(module) + engine, current, setup_wall, setup_cpu = _prepare_fixture( + module, + work, + args.claims, + args.plans, + targets_per_plan=args.targets_per_plan, + shared_build_root=args.shared_build_root, + existing_directories=args.existing_directories, + ) + profile = cProfile.Profile() + started = time.perf_counter() + with ( + module._ReconcileProgress(len(current), 0) as progress, + contextlib.ExitStack() as locks, + ): + progress.phase("waiting for read-only commit locks", "lock_wait") + locks.enter_context(module.FileLock(engine.lock_root / "registry.lock")) + roots = {module._path_key(plan.root): plan.root for plan in current} + for root in sorted(roots.values(), key=module._portable_identity): + locks.enter_context(module.FileLock(engine._generation_lock(root))) + for root in sorted(roots.values(), key=module._portable_identity): + locks.enter_context(module.FileLock(engine._publication_lock(root))) + lock_seconds = time.perf_counter() - started + progress.phase("checking all current plans", "validation") + total_started, total_cpu = time.perf_counter(), time.process_time() + started = time.perf_counter() + engine._validate_plan_set(current) + current_seconds = time.perf_counter() - started + engine.validation_metrics = { + "mode": "commit-candidate-only", + "authoritative": "none", + } + progress.phase("read-only provisional observation commit", "validation") + started, cpu = time.perf_counter(), time.process_time() + if not args.no_profile: + profile.enable() + try: + accepted = engine._preview_committed_index( + current, set(), progress=progress + ) + finally: + if not args.no_profile: + profile.disable() + committed_seconds = time.perf_counter() - started + committed_cpu = time.process_time() - cpu + if not args.no_profile: + profile.dump_stats(work / "candidate.prof") + total_seconds = time.perf_counter() - total_started + total_cpu_seconds = time.process_time() - total_cpu + assert accepted + metrics = engine.validation_metrics + assert metrics["commit_certificate"] == "verified" + assert metrics["commit_claims_checked"] == args.claims + assert metrics["commit_records_read"] == 2 * args.claims + assert metrics["commit_state"] == "closed" + assert metrics["commit_handles_opened"] == metrics["commit_handles_closed"] + oracle_wall = oracle_cpu = None + if args.reference_oracle: + progress.phase("fresh reference oracle (separate timing)", "validation") + started, cpu = time.perf_counter(), time.process_time() + engine._validate_registry_reference(current, set(), progress=progress) + oracle_wall = time.perf_counter() - started + oracle_cpu = time.process_time() - cpu + assert len(list((engine.lock_root / "roots").glob("*/claim.json"))) == args.claims + if _implementation_fingerprint(module) != expected: + raise RuntimeError( + "coordinator sources changed during the sample; discard its timings" + ) + return { + "scope": "complete read-only committed candidate; no reconciliation authority", + "cprofile_enabled": not args.no_profile, + "reference_validation_performed": args.reference_oracle, + "reference_result": "accepted" if args.reference_oracle else None, + "reconciliation_authorized": False, + "tokens_produced": 0, + "implementation_files": expected, + "retained_claims": args.claims, + "current_plans": args.plans, + "layout": { + "targets_per_plan": args.targets_per_plan, + "shared_build_root": args.shared_build_root, + "existing_directories": args.existing_directories, + }, + "setup_wall_seconds": setup_wall, + "setup_cpu_seconds": setup_cpu, + "lock_preparation_and_wait_seconds": lock_seconds, + "current_plan_validation_seconds": current_seconds, + "committed_candidate_wall_seconds": committed_seconds, + "committed_candidate_cpu_seconds": committed_cpu, + "all_candidate_validation_wall_seconds": total_seconds, + "all_candidate_validation_cpu_seconds": total_cpu_seconds, + "reference_oracle_wall_seconds": oracle_wall, + "reference_oracle_cpu_seconds": oracle_cpu, + "candidate_filesystem_calls": _filesystem_counts(profile) + if not args.no_profile + else None, + "index_experiment": metrics, + } + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--claims", type=int, default=64) + parser.add_argument("--plans", type=int, default=11) + parser.add_argument("--repeat", type=int, default=1) + parser.add_argument("--large", action="store_true") + parser.add_argument("--work", type=Path) + parser.add_argument("--targets-per-plan", type=int, default=1) + parser.add_argument("--shared-build-root", action="store_true") + parser.add_argument("--existing-directories", action="store_true") + parser.add_argument("--reference-oracle", action="store_true") + parser.add_argument( + "--no-profile", + action="store_true", + help="use wall/CPU timers and native counters without cProfile overhead", + ) + args = parser.parse_args() + if not 0 <= args.claims <= 4096 or not 1 <= args.plans <= 32: + parser.error("expected 0..4096 claims and 1..32 plans") + if args.claims > 128 and not args.large: + parser.error("more than 128 claims requires explicit --large opt-in") + if not 1 <= args.repeat <= 20 or not 1 <= args.targets_per_plan <= 8: + parser.error("expected 1..20 repetitions and 1..8 targets per plan") + if args.work: + work = args.work.absolute() + work.mkdir(parents=True, exist_ok=False) + else: + work = Path(tempfile.mkdtemp(prefix="protocyte-observation-commit-")) + module = _load(Path(__file__).resolve().parents[1], "commit_candidate_only") + results = { + "platform": platform.system(), + "python": platform.python_version(), + "timings_include_instrumentation": True, + "implementation_files": _implementation_fingerprint(module), + "samples": [], + } + print(f"Private synthetic work and path-free results: {work}", flush=True) + for repetition in range(args.repeat): + measured = { + "repetition": repetition, + **sample(module, work / f"r{repetition}", args), + } + results["samples"].append(measured) + (work / "results.json").write_text( + json.dumps(results, indent=2) + "\n", encoding="utf-8" + ) + print(json.dumps(measured), flush=True) + + +if __name__ == "__main__": + main() diff --git a/tests/benchmark_output_registry.py b/tests/benchmark_output_registry.py index 7358389..5e969b2 100644 --- a/tests/benchmark_output_registry.py +++ b/tests/benchmark_output_registry.py @@ -87,7 +87,11 @@ def encode(value: Path | str) -> str: def _implementation_fingerprint(module: ModuleType) -> dict[str, str]: paths = [Path(module.__file__)] - for name in ("ProtocyteOwnershipIndex.py", "ProtocytePathObservation.py"): + for name in ( + "ProtocyteOwnershipIndex.py", + "ProtocytePathObservation.py", + "ProtocyteObservationCommit.py", + ): helper = paths[0].with_name(name) if helper.is_file(): paths.append(helper) @@ -317,6 +321,10 @@ def scandir(path: Any) -> Any: "registry_lock_held_wall_seconds": registry_held, "current_plan_validation_wall_seconds": current_validation, "validation_engine": registry_validation, + "python_registry_scans": counts["registry_scans"], + "native_registry_inventory_scans": getattr( + engine, "validation_metrics", {} + ).get("commit_full_inventory_scans", 0), "index_experiment": getattr(engine, "validation_metrics", {}), "shadow_candidate_wall_seconds": getattr(engine, "validation_metrics", {}).get( "preview_wall_seconds", 0.0 @@ -324,7 +332,13 @@ def scandir(path: Any) -> Any: "reference_validation_wall_seconds": getattr( engine, "validation_metrics", {} ).get("reference_wall_seconds", validation_wall), - **counts, + **{ + **counts, + "registry_scans": counts["registry_scans"] + + getattr(engine, "validation_metrics", {}).get( + "commit_full_inventory_scans", 0 + ), + }, "validation_filesystem_calls": filesystem_calls, "completed_plans": len(tokens), } @@ -345,7 +359,7 @@ def main() -> None: parser.add_argument("--existing-directories", action="store_true") parser.add_argument( "--registry-validation", - choices=("reference", "shadow", "native-shadow"), + choices=("reference", "shadow", "native-shadow", "commit-shadow"), default="reference", ) parser.add_argument( diff --git a/tests/registry_validation_poc.py b/tests/registry_validation_poc.py index 2fd8c19..852cce2 100644 --- a/tests/registry_validation_poc.py +++ b/tests/registry_validation_poc.py @@ -233,7 +233,7 @@ def main(): parser.add_argument("--work", type=Path) parser.add_argument( "--registry-validation", - choices=("reference", "shadow", "native-shadow"), + choices=("reference", "shadow", "native-shadow", "commit-shadow"), default="reference", ) args = parser.parse_args() @@ -261,6 +261,7 @@ def main(): source, source.with_name("ProtocyteOwnershipIndex.py"), source.with_name("ProtocytePathObservation.py"), + source.with_name("ProtocyteObservationCommit.py"), ) if path.is_file() }, @@ -281,6 +282,7 @@ def main(): source, source.with_name("ProtocyteOwnershipIndex.py"), source.with_name("ProtocytePathObservation.py"), + source.with_name("ProtocyteObservationCommit.py"), ) if path.is_file() } diff --git a/tests/test_observation_commit.py b/tests/test_observation_commit.py new file mode 100644 index 0000000..c440cf9 --- /dev/null +++ b/tests/test_observation_commit.py @@ -0,0 +1,658 @@ +from __future__ import annotations + +import ctypes +import importlib.util +import os +import struct +import sys +from collections import defaultdict +from pathlib import Path +from types import SimpleNamespace + +import pytest + + +spec = importlib.util.spec_from_file_location( + "observation_commit_test_helpers", + Path(__file__).with_name("test_output_coordinator.py"), +) +assert spec and spec.loader +helpers = importlib.util.module_from_spec(spec) +sys.modules[spec.name] = helpers +spec.loader.exec_module(helpers) +coordinator = helpers.coordinator +commit = coordinator._load_observation_commit() +native = coordinator._load_path_observation() +model = coordinator._load_ownership_index() + + +@pytest.fixture(autouse=True) +def quiet_native_commit_cases(request, tmp_path_factory): + # Close-marker posts are deliberately treated as version changes, including + # posts by another observer. Give quiet-baseline tests a private session gate; + # the explicit overlap test below exercises invalidation instead. + base = tmp_path_factory.getbasetemp() + if getattr(request.config, "workerinput", None) is not None: + base = base.parent + with coordinator.FileLock(base / "observation-commit-tests.lock"): + yield + + +@pytest.fixture +def native_capability(tmp_path): + if os.name != "nt": + pytest.skip("native commit witnesses require Windows") + scope = commit.WindowsObservationCommit(native, model) + try: + scope.project(tmp_path) + scope.seal() + except commit.CapabilityUnavailable as error: + pytest.skip(str(error)) + finally: + scope.close() + + +def _record(usn: int, file_id: int, reason: int, major: int = 2) -> bytes: + minimum = 60 if major == 2 else 76 + length = (minimum + 7) & ~7 + data = bytearray(length) + struct.pack_into(" None: + page = struct.pack(" None: + flags = 0 if reason == 0 else commit.CLOSE_REASON | reason + with pytest.raises(commit.ObservationChanged): + commit.verify_witnesses({100: 11}, [commit.JournalRecord(100, 11, flags)]) + + +@pytest.mark.parametrize( + "records", + [ + [], + [commit.JournalRecord(101, 11, commit.CLOSE_REASON)], + [commit.JournalRecord(100, 12, commit.CLOSE_REASON)], + [commit.JournalRecord(100, 11, commit.CLOSE_REASON)] * 2, + ], +) +def test_missing_wrong_or_duplicate_records_cannot_certify_a_read_set(records) -> None: + with pytest.raises(commit.CommitUnavailable): + commit.verify_witnesses({100: 11}, records) + + +@pytest.mark.parametrize( + "corruption", + ["short", "truncated", "version", "minor", "length", "name", "backward", "cursor"], +) +def test_journal_parser_fails_closed_on_unsupported_or_malformed_data( + corruption: str, +) -> None: + record = bytearray(_record(100, 11, commit.CLOSE_REASON)) + cursor = 200 + if corruption == "short": + page = b"short" + elif corruption == "truncated": + page = struct.pack(" None: + scope = object.__new__(commit.WindowsObservationCommit) + scope._counts = defaultdict(int) + scope.MAX_JOURNAL_BYTES = 8 if failure == "budget" else 1024 + epochs = iter( + [ + (2 if failure == "epoch" else 1, 101 if failure == "trim" else 0, 200), + (2 if failure == "epoch-after" else 1, 0, 200), + ] + ) + scope._epoch = lambda handle: next(epochs) + records = ( + b"" + if failure in ("missing", "stalled") + else _record(100, 11, commit.CLOSE_REASON | (1 if failure == "changed" else 0)) + ) + scope._io = lambda *args: ( + struct.pack(" None: + directory = tmp_path / "existing 🧬" + directory.mkdir() + assert readset.project(directory) == directory + assert not readset.overlaps(tmp_path / "missing-a", tmp_path / "missing-b") + # Only volume roots are retained. Ordinary directory observations close now. + roots = {id(view.guard) for view in readset._roots.values()} + assert all( + guard.handle is None or id(guard) in roots + for guard in readset._objects.values() + ) + readset.seal() + assert readset.metrics()["commit_state"] == "sealed" + assert readset.metrics()["commit_witnesses"] == len(readset._objects) + with pytest.raises(commit.ObservationChanged, match="outside"): + readset.project(directory) + + +def test_existing_object_delete_and_recreate_is_not_blocked_and_invalidates( + tmp_path: Path, readset +) -> None: + directory = tmp_path / "existing" + directory.mkdir() + readset.project(directory) + directory.rmdir() + directory.mkdir() + with pytest.raises(commit.ObservationChanged): + readset.seal() + + +def test_rename_aba_cannot_pass_even_when_name_and_identity_return( + tmp_path: Path, readset +) -> None: + directory, moved = tmp_path / "existing", tmp_path / "moved" + directory.mkdir() + readset.project(directory) + directory.rename(moved) + moved.rename(directory) + with pytest.raises(commit.ObservationChanged): + readset.seal() + + +def test_record_content_aba_with_restored_timestamp_invalidates( + tmp_path: Path, readset +) -> None: + record = tmp_path / "claim.json" + data = b'{"value":1}\n' + record.write_bytes(data) + assert readset.read_json(record, "test record") == {"value": 1} + original = record.stat() + record.write_bytes(b'{"value":2}\n') + record.write_bytes(data) + os.utime(record, ns=(original.st_atime_ns, original.st_mtime_ns)) + with pytest.raises(commit.ObservationChanged): + readset.seal() + + +def test_reparse_aba_from_a_preexisting_attribute_writer_cannot_certify( + tmp_path: Path, readset +) -> None: + from ctypes import wintypes as w + + directory, target = tmp_path / "existing", tmp_path / "target" + directory.mkdir() + target.mkdir() + create = readset.reader._kernel.CreateFileW + create.argtypes = ( + w.LPCWSTR, + w.DWORD, + w.DWORD, + w.LPVOID, + w.DWORD, + w.DWORD, + w.HANDLE, + ) + create.restype = w.HANDLE + writer = create(str(directory), 0x100, 7, None, 3, 0x02200000, None) + assert writer != ctypes.c_void_p(-1).value + + def reparse(set_point: bool): + if set_point: + substitute = ("\\??\\" + str(target)).encode("utf-16-le") + printable = str(target).encode("utf-16-le") + names = substitute + b"\x00\x00" + printable + b"\x00\x00" + data = ( + struct.pack( + " None: + missing = tmp_path / "missing" + assert not readset.overlaps(missing, tmp_path / "other") + missing.mkdir() + with pytest.raises(commit.ObservationChanged): + readset.overlaps( + missing, tmp_path / "other" + ) if phase == "comparison" else readset.seal() + + +def test_case_aliases_fall_back_without_resetting_prior_versions( + tmp_path: Path, readset +) -> None: + directory = tmp_path / "MixedCase" + directory.mkdir() + first = readset.facts(directory) + start = readset._objects[first.location[:2]].start_usn + with pytest.raises(commit.CapabilityUnavailable, match="noncanonical"): + readset.facts(tmp_path / "mixedcase") + assert readset._objects[first.location[:2]].start_usn == start + + +def test_overlapping_read_sets_invalidate_rather_than_certify_changed_versions( + tmp_path: Path, readset +) -> None: + other = commit.WindowsObservationCommit(native, model) + try: + readset.project(tmp_path) + other.project(tmp_path) + with pytest.raises(commit.ObservationChanged): + readset.seal() + other.seal() + finally: + other.close() + + +def _plan(tmp_path: Path, name: str): + return helpers._write_plan( + tmp_path / f"{name}.plan", + tmp_path / name / "generated", + tmp_path / name / "build", + ((helpers._target(name), "sample.protocyte.hpp"),), + ) + + +@pytest.mark.parametrize("phase", ["comparison", "seal"]) +def test_dangling_junction_cannot_masquerade_as_a_missing_component( + tmp_path: Path, readset, phase: str +) -> None: + missing, target = tmp_path / "missing", tmp_path / "target" + target.mkdir() + readset.project(missing / "generated") + helpers._directory_link(missing, target) + target.rmdir() + assert missing.is_junction() + with pytest.raises(commit.ObservationChanged): + readset.overlaps( + missing / "generated", tmp_path / "other" + ) if phase == "comparison" else readset.seal() + + +def test_default_never_loads_commit_reader( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + monkeypatch.setattr( + coordinator, + "_load_observation_commit", + lambda: pytest.fail("default loaded commit reader"), + ) + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="reference" + ) + assert engine.reconcile(_plan(tmp_path, "current")) + assert engine.validation_metrics["authoritative"] == "reference" + + +def test_negative_observations_are_refreshed_for_the_reverse_direction( + tmp_path: Path, readset, monkeypatch: pytest.MonkeyPatch +) -> None: + first, second = tmp_path / "first-missing", tmp_path / "second-missing" + readset.project(first) + readset.project(second) + original = readset._probe_absence + probes = 0 + + def replace_after_forward(request): + nonlocal probes + original(request) + probes += 1 + if probes == 2: + first.touch() + + monkeypatch.setattr(readset, "_probe_absence", replace_after_forward) + with pytest.raises(commit.ObservationChanged): + readset.overlaps(first, second) + + +@pytest.mark.parametrize("restore", [False, True]) +def test_case_mode_changes_preserve_exact_bindings_without_versioned_flags( + tmp_path: Path, readset, restore: bool +) -> None: + from ctypes import wintypes as w + + directory = tmp_path / "case-mode" + directory.mkdir() + create = readset.reader._kernel.CreateFileW + create.argtypes = ( + w.LPCWSTR, + w.DWORD, + w.DWORD, + w.LPVOID, + w.DWORD, + w.DWORD, + w.HANDLE, + ) + create.restype = w.HANDLE + writer = create(str(directory), 0x100, 7, None, 3, 0x02200000, None) + assert writer != ctypes.c_void_p(-1).value + set_info = readset.reader._kernel.SetFileInformationByHandle + set_info.argtypes = (w.HANDLE, ctypes.c_int, w.LPVOID, w.DWORD) + set_info.restype = w.BOOL + + def set_mode(enabled): + flag = w.DWORD(int(enabled)) + if not set_info(writer, 23, ctypes.byref(flag), ctypes.sizeof(flag)): + error = ctypes.get_last_error() + if error in (1, 5, 50, 87, 1314): + pytest.skip(f"case sensitivity mutation unavailable: error {error}") + raise ctypes.WinError(error) + + try: + readset.project(directory) + before = readset._objects[readset.facts(directory).location[:2]].start_usn + set_mode(True) + if restore: + set_mode(False) + # On NTFS this mode can change without advancing the USN. The read set + # must not depend on mode stability: it only reuses exact name bindings. + with readset._lease(readset._view(directory).guard) as handle: + versioned = readset._version(handle) != before + if versioned: + with pytest.raises(commit.ObservationChanged): + readset.seal() + else: + readset.seal() + finally: + try: + set_mode(False) + finally: + assert readset.reader._close(writer) + + +@pytest.mark.parametrize("positive_mask", range(8)) +def test_partitioned_index_matches_reference_ownership_and_retirement( + positive_mask: int, +) -> None: + names = ("root", "stage", "other") + facts = {} + for number, name in enumerate(names, start=2): + key = (7, number, ()) + facts[name] = model.DirectoryObservation("/" + name, key, (key, (7, 1, ()))) + + class Filesystem: + def is_stable(self, path): + return bool(positive_mask & (1 << names.index(path))) + + def facts(self, path): + return facts[path] + + def overlaps(self, first, second): + # Independent exhaustive predicate, as used by the reference path. + left, right = facts[first], facts[second] + return ( + left.portable == right.portable + or left.portable.startswith(right.portable + "/") + or right.portable.startswith(left.portable + "/") + or left.location in right.ancestors + or right.location in left.ancestors + ) + + filesystem = Filesystem() + reservations = ( + model.Reservation("root", "old", "build", None, facts["root"]), + model.Reservation("staging", "old", "build", "target", facts["stage"]), + ) + cases = ( + ("root", None, "new", "build", "target", set(), "root-root"), + ("root", None, "old", "other-build", "target", set(), None), + ("stage", None, "old", "build", "target", set(), "root-staging"), + ("other", "root", "new", "build", "target", set(), "staging-root"), + ("other", "stage", "old", "build", "target", set(), None), + ("other", "stage", "new", "build", "target", {"old"}, None), + ("other", "stage", "new", "other-build", "target", {"old"}, "staging-staging"), + ("other", "stage", "new", "build", "other-target", {"old"}, "staging-staging"), + ("other", "stage", "new", "build", "target", set(), "staging-staging"), + ) + for root, stage, root_key, build, target, retiring, expected in cases: + index = commit.ProvisionalOwnershipIndex( + model, + filesystem, + tuple( + (reservation, path, filesystem.is_stable(path)) + for reservation, path in zip(reservations, names) + ), + ) + assert ( + index.conflict( + root=root, + root_key=root_key, + build_id=build, + staging=() if stage is None else ((target, stage),), + retiring_root_keys=retiring, + ) + == expected + ) + + +@pytest.mark.parametrize( + "error", + [commit.CapabilityUnavailable("no capability"), RuntimeError("unexpected failure")], +) +def test_unavailable_or_failed_commit_uses_reference_and_preserves_existing_token( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, error: Exception +) -> None: + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="reference" + ) + plan = _plan(tmp_path, "current") + token = engine.reconcile(plan) + state = engine._state_directory(plan.root) + claim_bytes = (state / "claim.json").read_bytes() + + def unavailable(*args, **kwargs): + raise error + + monkeypatch.setattr(engine, "_preview_committed_index", unavailable) + engine.registry_validation = "commit-shadow" + assert engine.reconcile(plan) == token + assert (state / "claim.json").read_bytes() == claim_bytes + assert engine.validation_metrics["fallback"] == "reference" + assert engine.validation_metrics["commit_certificate"] == "unverified" + assert engine.validation_metrics["reference_result"] == "accepted" + + +def test_commit_conflict_disagreement_cannot_initialize_a_new_claim( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="reference" + ) + engine.reconcile(_plan(tmp_path, "retained")) + monkeypatch.setattr( + engine, "_preview_committed_index", lambda *args, **kwargs: False + ) + engine.registry_validation = "commit-shadow" + with pytest.raises(coordinator.CoordinatorError, match="disagrees"): + engine.reconcile(_plan(tmp_path, "current")) + assert engine.validation_metrics["reference_result"] == "accepted" + assert len(list((engine.lock_root / "roots").glob("*/claim.json"))) == 1 + + +@pytest.mark.parametrize( + "other_flag", ["--experimental-registry-index", "--experimental-native-observation"] +) +def test_commit_flag_rejects_other_experiments_before_mutation( + tmp_path: Path, capsys, other_flag: str +) -> None: + locks = tmp_path / "locks" + assert ( + coordinator.main( + [ + "reconcile", + "--lock-root", + str(locks), + "--experimental-observation-commit", + other_flag, + ] + ) + == 1 + ) + assert "choose one experimental" in capsys.readouterr().err + assert not locks.exists() + + +@pytest.mark.skipif(os.name != "nt", reason="native commit witnesses require Windows") +def test_commit_shadow_authenticates_records_closes_scopes_then_uses_reference( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, native_capability +) -> None: + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="reference" + ) + engine.reconcile_set((), [_plan(tmp_path, f"retained-{n}") for n in range(3)]) + engine.registry_validation = "commit-shadow" + initialize = engine._initialize_claim_locked + + def checked(state, plan): + assert engine.validation_metrics["reference_result"] == "accepted" + assert engine.validation_metrics["commit_certificate"] == "verified" + assert engine.validation_metrics["commit_state"] == "closed" + initialize(state, plan) + + monkeypatch.setattr(engine, "_initialize_claim_locked", checked) + assert engine.reconcile(_plan(tmp_path, "current")) + metrics = engine.validation_metrics + assert metrics["agreement"] is True + assert metrics["commit_claims_checked"] == 3 + assert metrics["commit_records_read"] == 6 + assert metrics["commit_handles_opened"] == metrics["commit_handles_closed"] + + +@pytest.mark.skipif(os.name != "nt", reason="native commit witnesses require Windows") +def test_changed_but_safe_observation_falls_back_without_breaking_a_build( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, native_capability +) -> None: + retained = _plan(tmp_path, "retained") + engine = coordinator.OutputCoordinator(tmp_path / "locks") + engine.reconcile(retained) + engine.registry_validation = "commit-shadow" + + def inject(phase): + if phase == "before-observation-commit": + retained.root.mkdir() + + monkeypatch.setattr(engine, "_inject", inject) + assert engine.reconcile(_plan(tmp_path, "current")) + assert engine.validation_metrics["fallback"] == "reference" + assert engine.validation_metrics["reference_result"] == "accepted" + + +@pytest.mark.parametrize( + "phase", ["before-observation-commit", "after-observation-commit"] +) +@pytest.mark.skipif(os.name != "nt", reason="native commit witnesses require Windows") +def test_foreign_change_before_or_after_commit_cannot_bypass_reference( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, phase: str, native_capability +) -> None: + retained = _plan(tmp_path, "retained") + engine = coordinator.OutputCoordinator(tmp_path / "locks") + engine.reconcile(retained) + engine.registry_validation = "commit-shadow" + + def inject(current): + if current == phase: + retained.root.touch() + + monkeypatch.setattr(engine, "_inject", inject) + with pytest.raises(coordinator.CoordinatorError, match="non-directory"): + engine.reconcile(_plan(tmp_path, "current")) + assert engine.validation_metrics["reference_result"] == "rejected" + assert len(list((engine.lock_root / "roots").glob("*/claim.json"))) == 1 diff --git a/tests/test_output_coordinator.py b/tests/test_output_coordinator.py index fe6463a..bde0214 100644 --- a/tests/test_output_coordinator.py +++ b/tests/test_output_coordinator.py @@ -2099,6 +2099,68 @@ def reject_state(path: Path) -> object: engine.reconcile(second) +def test_unreadable_recorded_plan_metadata_fails_closed( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + retained = _write_plan( + tmp_path / "retained.plan", + tmp_path / "retained/generated", + tmp_path / "retained/build", + ((_target("retained"), "sample.protocyte.hpp"),), + ) + current = _write_plan( + tmp_path / "current.plan", + tmp_path / "current/generated", + tmp_path / "current/build", + ((_target("current"), "sample.protocyte.hpp"),), + ) + engine = coordinator.OutputCoordinator(tmp_path / "locks") + token = engine.reconcile(retained) + recorded = engine._state_directory(retained.root) / "plan.json" + original_lstat = Path.lstat + + def denied(path: Path, *args: object, **kwargs: object) -> os.stat_result: + if path == recorded: + raise PermissionError("metadata denied by test") + return original_lstat(path, *args, **kwargs) + + monkeypatch.setattr(Path, "lstat", denied) + with pytest.raises(coordinator.CoordinatorError, match="could not inspect configured output plan"): + engine.reconcile(current) + claim = engine._state_directory(retained.root) / "claim.json" + assert json.loads(claim.read_bytes())["token"] == token + assert len(list((engine.lock_root / "roots").glob("*/claim.json"))) == 1 + + +def test_dangling_recorded_plan_is_rejected_instead_of_treated_as_absent( + tmp_path: Path, +) -> None: + retained = _write_plan( + tmp_path / "retained.plan", + tmp_path / "retained/generated", + tmp_path / "retained/build", + ((_target("retained"), "sample.protocyte.hpp"),), + ) + current = _write_plan( + tmp_path / "current.plan", + tmp_path / "current/generated", + tmp_path / "current/build", + ((_target("current"), "sample.protocyte.hpp"),), + ) + engine = coordinator.OutputCoordinator(tmp_path / "locks") + engine.reconcile(retained) + recorded = engine._state_directory(retained.root) / "plan.json" + recorded.unlink() + target = tmp_path / "removed-plan-target" + target.mkdir() + _directory_link(recorded, target) + target.rmdir() + assert not recorded.exists() and os.path.lexists(recorded) + with pytest.raises(coordinator.CoordinatorError, match="symbolic link or junction"): + engine.reconcile(current) + assert len(list((engine.lock_root / "roots").glob("*/claim.json"))) == 1 + + def test_physical_output_root_aliases_cannot_receive_distinct_claims( tmp_path: Path, monkeypatch: pytest.MonkeyPatch ) -> None: diff --git a/tests/test_output_coordinator_cmake.py b/tests/test_output_coordinator_cmake.py index 8944db8..b8c0586 100644 --- a/tests/test_output_coordinator_cmake.py +++ b/tests/test_output_coordinator_cmake.py @@ -64,7 +64,7 @@ def test_default_registry_selector_uses_the_isolated_test_cache(tmp_path: Path) @pytest.mark.parametrize( "experimental_flag", - ["--experimental-registry-index", "--experimental-native-observation"], + ["--experimental-registry-index", "--experimental-native-observation", "--experimental-observation-commit"], ) def test_installed_shadow_coordinator_is_relocatable_and_keeps_prefix_unchanged( tmp_path: Path, @@ -78,6 +78,7 @@ def test_installed_shadow_coordinator_is_relocatable_and_keeps_prefix_unchanged( script = next(relocated.rglob("ProtocyteOutputCoordinator.py")) assert script.with_name("ProtocyteOwnershipIndex.py").is_file() assert script.with_name("ProtocytePathObservation.py").is_file() + assert script.with_name("ProtocyteObservationCommit.py").is_file() def contents() -> dict[str, bytes]: return { diff --git a/tests/verify_coordinator_upgrade.py b/tests/verify_coordinator_upgrade.py new file mode 100644 index 0000000..bf42fd0 --- /dev/null +++ b/tests/verify_coordinator_upgrade.py @@ -0,0 +1,398 @@ +"""Offline protocol-v1 upgrade/rollback and crash-recovery qualification. + +Run with Python 3.12+ from a checkout containing the pinned public source blob +and preservation checkpoint. Every case uses a fresh private registry. No consumer +registry or remote service is accessed. Publish upgrade-results.json only; the +fixture records and subprocess logs can contain private paths and claim tokens. +""" + +from __future__ import annotations + +import ast +import argparse +import hashlib +import importlib.util +import json +import os +import subprocess +import sys +import tempfile +from pathlib import Path + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "--work", type=Path, help="new private result/fixture directory" + ) + options = parser.parse_args() + REPO = Path(__file__).resolve().parents[1] + WORK = ( + options.work.absolute() + if options.work + else Path(tempfile.mkdtemp(prefix="protocyte-upgrade-")) + ) + if options.work: + WORK.mkdir(parents=True, exist_ok=False) + LEGACY = WORK / "legacy/ProtocyteOutputCoordinator.py" + CURRENT = REPO / "cmake/ProtocyteOutputCoordinator.py" + LEGACY.parent.mkdir() + LEGACY.write_bytes( + subprocess.check_output( + [ + "git", + "show", + "25f1660190d3d1015fef3955814c8c737bd686c5", + ], + cwd=REPO, + ) + ) + assert ( + hashlib.sha256(LEGACY.read_bytes()).hexdigest() + == "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85" + ) + IMPLEMENTATION = ( + CURRENT, + *( + CURRENT.with_name(name) + for name in ( + "ProtocyteOwnershipIndex.py", + "ProtocytePathObservation.py", + "ProtocyteObservationCommit.py", + ) + ), + ) + EXPECTED_SOURCES = { + path.name: hashlib.sha256(path.read_bytes()).hexdigest() + for path in IMPLEMENTATION + } + + def load(name: str, script: Path): + spec = importlib.util.spec_from_file_location(name, script) + module = importlib.util.module_from_spec(spec) + sys.modules[name] = module + exec(compile(script.read_bytes(), os.fspath(script), "exec"), module.__dict__) + return module + + old = load("review_legacy", LEGACY) + new = load("review_current", CURRENT) + assert old.PROTOCOL_VERSION == new.PROTOCOL_VERSION == 1 + assert old.PLAN_HEADER == new.PLAN_HEADER + + def functions(source: bytes): + tree = ast.parse(source) + return { + node.name: node + for node in tree.body + if isinstance(node, (ast.FunctionDef, ast.ClassDef)) + } + + checkpoint = functions( + subprocess.check_output( + ["git", "show", "f804fd1:cmake/ProtocyteOutputCoordinator.py"], cwd=REPO + ) + ) + candidate = functions(CURRENT.read_bytes()) + old_methods = { + node.name: node + for node in checkpoint["OutputCoordinator"].body + if isinstance(node, ast.FunctionDef) + } + new_methods = { + node.name: node + for node in candidate["OutputCoordinator"].body + if isinstance(node, ast.FunctionDef) + } + unchanged = [] + for name in ( + "reconcile_set", + "_reconcile_locked", + "validate", + "publish", + "reset", + "_recover", + "_apply_pending", + "_publish_one", + "_initialize_claim_locked", + "_release_claim", + "_generation_lock", + "_publication_lock", + ): + assert ast.dump(old_methods[name]) == ast.dump(new_methods[name]), name + unchanged.append(name) + reference = new_methods["_validate_registry_reference"] + reference.name = "_validate_registry" + reference_unchanged = ast.dump(old_methods["_validate_registry"]) == ast.dump( + reference + ) + assert ast.dump(checkpoint["FileLock"]) == ast.dump(candidate["FileLock"]) + + def engine(version: str, locks: Path): + if version == "old": + return old.OutputCoordinator(locks) + return new.OutputCoordinator(locks, registry_validation=version) + + def module(version: str): + return old if version == "old" else new + + def fixture(name: str): + directory = WORK / "fixtures" / name + directory.mkdir(parents=True, exist_ok=False) + build = directory / "build" + build.mkdir() + root = directory / "generated" + locks = directory / "locks" + plan = directory / "outputs.plan" + target = hashlib.sha256(b"upgrade-target").hexdigest() + staging = directory / (".protocyte-generation-staging-" + target) / "generated" + + def encode(value): + return os.fspath(value).encode().hex() + + plan.write_text( + "\n".join( + [ + old.PLAN_HEADER, + "root-hex=" + encode(root), + "build-root-hex=" + encode(build), + "target=" + target + "|" + encode(staging.parent), + "output=" + target + "|" + encode("demo.protocyte.cpp"), + "output=" + target + "|" + encode("demo.protocyte.hpp"), + ] + ) + + "\n", + encoding="ascii", + ) + assert old.Plan.read(plan).payload == new.Plan.read(plan).payload + assert old.Plan.read(plan).digest == new.Plan.read(plan).digest + return root, locks, plan, target, staging + + def stage(staging: Path, generation: int): + staging.mkdir(parents=True, exist_ok=True) + for suffix in ("cpp", "hpp"): + (staging / ("demo.protocyte." + suffix)).write_bytes( + f"// generated {generation}\n".encode() + ) + + def verify_outputs(root: Path, generation: int): + for suffix in ("cpp", "hpp"): + assert ( + root / ("demo.protocyte." + suffix) + ).read_bytes() == f"// generated {generation}\n".encode() + + def run(version: str, command: str, locks: Path, plan: Path, extras=(), crash=None): + args = [ + sys.executable, + os.fspath(LEGACY if version == "old" else CURRENT), + command, + "--lock-root", + os.fspath(locks), + "--plan", + os.fspath(plan), + *extras, + ] + if version == "shadow": + args.append("--experimental-registry-index") + elif version == "native-shadow": + args.append("--experimental-native-observation") + elif version == "commit-shadow": + args.append("--experimental-observation-commit") + environment = os.environ.copy() + environment.pop("PROTOCYTE_COORDINATOR_CRASH_AFTER", None) + if crash: + environment["PROTOCYTE_COORDINATOR_CRASH_AFTER"] = crash + completed = subprocess.run( + args, env=environment, capture_output=True, timeout=40 + ) + assert completed.returncode == (86 if crash else 0), ( + version, + command, + crash, + completed.returncode, + completed.stderr, + ) + return completed + + results = [] + transitions = ( + ("old", "reference"), + ("old", "shadow"), + ("reference", "old"), + ("shadow", "old"), + ("old", "native-shadow"), + ("native-shadow", "old"), + ("old", "commit-shadow"), + ("commit-shadow", "old"), + ) + for writer, reader in transitions: + root, locks, plan, target, staging = fixture(f"steady-{writer}-{reader}") + first, second = engine(writer, locks), engine(reader, locks) + first_plan, second_plan = ( + module(writer).Plan.read(plan), + module(reader).Plan.read(plan), + ) + token = first.reconcile(first_plan) + state = first._state_directory(root) + assert first._generation_lock(root) == second._generation_lock(root) + assert first._publication_lock(root) == second._publication_lock(root) + claim = (state / "claim.json").read_bytes() + stage(staging, 1) + first.publish(first_plan, target, staging) + unchanged_outputs = { + path.name: (path.read_bytes(), path.stat().st_mtime_ns) + for path in root.iterdir() + } + assert second.reconcile(second_plan) == token + second.validate(second_plan) + assert (state / "claim.json").read_bytes() == claim + assert unchanged_outputs == { + path.name: (path.read_bytes(), path.stat().st_mtime_ns) + for path in root.iterdir() + } + stage(staging, 2) + second.publish(second_plan, target, staging) + first.validate(first_plan) + assert first.reconcile(first_plan) == token + verify_outputs(root, 2) + results.append( + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": writer, + "reader": reader, + "passed": True, + } + ) + + for writer, reader in ( + ("old", "reference"), + ("old", "shadow"), + ("shadow", "old"), + ("old", "native-shadow"), + ("native-shadow", "old"), + ("old", "commit-shadow"), + ("commit-shadow", "old"), + ): + for phase in ( + "after-pending", + "after-output-1", + "after-output-2", + "after-snapshot", + ): + root, locks, plan, target, staging = fixture( + f"publish-{writer}-{reader}-{phase}" + ) + first = engine(writer, locks) + p = module(writer).Plan.read(plan) + token = first.reconcile(p) + stage(staging, 1) + first.publish(p, target, staging) + stage(staging, 2) + run( + writer, + "publish", + locks, + plan, + ("--target", target, "--staging-root", os.fspath(staging)), + crash=phase, + ) + for payload in staging.iterdir(): + payload.unlink() + second = engine(reader, locks) + assert second.reconcile(module(reader).Plan.read(plan)) == token + verify_outputs(root, 2) + assert not list((second._state_directory(root) / "transactions").iterdir()) + results.append( + { + "kind": "publication-crash-recovery", + "writer": writer, + "reader": reader, + "cut": phase, + "passed": True, + } + ) + for phase in ("after-initial-snapshot", "after-claim"): + root, locks, plan, target, staging = fixture( + f"init-{writer}-{reader}-{phase}" + ) + run(writer, "reconcile", locks, plan, crash=phase) + second = engine(reader, locks) + assert len(second.reconcile(module(reader).Plan.read(plan))) == 64 + second.validate(module(reader).Plan.read(plan)) + results.append( + { + "kind": "initialization-crash-recovery", + "writer": writer, + "reader": reader, + "cut": phase, + "passed": True, + } + ) + for phase in ( + "after-reset-intent", + "after-reset-output-1", + "after-reset-disposable", + ): + root, locks, plan, target, staging = fixture( + f"reset-{writer}-{reader}-{phase}" + ) + first = engine(writer, locks) + p = module(writer).Plan.read(plan) + token = first.reconcile(p) + stage(staging, 1) + first.publish(p, target, staging) + run(writer, "reset", locks, plan, ("--expected-claim", token), crash=phase) + second = engine(reader, locks) + second.reset(module(reader).Plan.read(plan), token) + assert not second._state_directory(root).exists() + assert not list(root.glob("*.protocyte.*")) + results.append( + { + "kind": "reset-crash-recovery", + "writer": writer, + "reader": reader, + "cut": phase, + "passed": True, + } + ) + + assert { + path.name: hashlib.sha256(path.read_bytes()).hexdigest() + for path in IMPLEMENTATION + } == EXPECTED_SOURCES, "sources changed during qualification; discard the run" + report = { + "scope": "isolated Windows cross-version checks; no consumer registry accessed", + "legacy_git_blob": "25f1660190d3d1015fef3955814c8c737bd686c5", + "legacy_coordinator_sha256": hashlib.sha256(LEGACY.read_bytes()).hexdigest(), + "candidate_coordinator_sha256": hashlib.sha256( + CURRENT.read_bytes() + ).hexdigest(), + "implementation_files": EXPECTED_SOURCES, + "candidate_helper_sha256": { + name: hashlib.sha256((CURRENT.parent / name).read_bytes()).hexdigest() + for name in ( + "ProtocyteOwnershipIndex.py", + "ProtocytePathObservation.py", + "ProtocyteObservationCommit.py", + ) + }, + "unchanged_ast_methods_since_checkpoint": unchanged, + "reference_validator_ast_unchanged_since_checkpoint": reference_unchanged, + "file_lock_ast_unchanged_since_checkpoint": True, + "passed_cases": len(results), + "cases": results, + } + (WORK / "upgrade-results.json").write_text(json.dumps(report, indent=2) + "\n") + print( + json.dumps( + { + "passed_cases": len(results), + "protocol": 1, + "unchanged_reference_validator": reference_unchanged, + "unchanged_file_locks": True, + } + ) + ) + + +if __name__ == "__main__": + main() From 8851bde4c72fcd82e0d58bed854c712c5d97742f Mon Sep 17 00:00:00 2001 From: Anthony Printup <92564080+anthonyprintup@users.noreply.github.com> Date: Mon, 16 Nov 2026 18:41:40 +0100 Subject: [PATCH 07/12] test(coordinator): qualify retained consumer workload without promotion - Identify the retained 751.875-second workload anonymously and authenticate its full current 2,239-claim, 11-plan registry without reconciling or publishing. - Add guarded read-only qualification, byte-identical frozen reference oracles, source fingerprints, and generated-byte/mtime and ownership preservation audits. - Prototype the indexed validation entry point behind a closed source promotion guard; consumer commands and ordinary API calls retain reference authority. - Coordinate native observers separately from the unchanged ownership locks, reject duplicate volume bindings, and preserve reference cleanup and diagnostics. - Exercise dirty end witnesses after the last version read, incomplete certificates, fresh mutation-time checks, and backend-consistent fault injection. - Extend offline old/new protocol-v1 qualification through indexed fixtures and crash cuts, preserving claim tokens and publication/recovery compatibility. - Reject unsafe source topology before freezing a ledger and remove a reproduced formatter-test startup race while retaining descendant-termination assertions. Validation: 1,863 default tests passed (41 platform/capability skips); 137 Python 3.12 checks passed; 89 indexed coordinator tests passed (6 platform skips); 91 cross-version cases passed; 21 CMake tests passed (1 platform skip), followed by 5 final-source relocated-install checks. Ruff and private-path checks pass. The ten-run integration gate measured 25.668-41.542 seconds, median 33.323, with only four samples below 30 seconds. Keep promotion disabled. Preserve the anonymous measurements and complete native counters for review. Refs #54. --- cmake/ProtocyteObservationCommit.py | 10 +- cmake/ProtocyteOutputCoordinator.py | 73 +- docs/consumer-validation-results.json | 2206 +++++++++++++++++ docs/consumer-validation-results.md | 165 ++ docs/observation-commit-contract.md | 83 +- docs/observation-commit-results.md | 5 + tests/test_consumer_registry_qualification.py | 180 ++ tests/test_observation_commit.py | 369 ++- tests/test_output_coordinator.py | 48 +- tests/test_output_coordinator_cmake.py | 26 +- tests/test_ownership_index.py | 2 +- tests/test_plugin.py | 35 +- tests/verify_consumer_registry.py | 424 ++++ tests/verify_coordinator_upgrade.py | 40 +- 14 files changed, 3597 insertions(+), 69 deletions(-) create mode 100644 docs/consumer-validation-results.json create mode 100644 docs/consumer-validation-results.md create mode 100644 tests/test_consumer_registry_qualification.py create mode 100644 tests/verify_consumer_registry.py diff --git a/cmake/ProtocyteObservationCommit.py b/cmake/ProtocyteObservationCommit.py index 2786b89..eb6f14f 100644 --- a/cmake/ProtocyteObservationCommit.py +++ b/cmake/ProtocyteObservationCommit.py @@ -3,7 +3,8 @@ Positive objects use root-anchored short opens and exact ID/version witnesses. Only volume roots retain handles; foreign build directories are not pinned. Negative namespace observations are refreshed at every comparison and commit. -The coordinator still performs its ordinary reference validation afterward. +The coordinator decides authority only after seal and complete handle release; +no observations may cross into reconciliation or publication mutations. """ from __future__ import annotations @@ -459,6 +460,13 @@ def _root(self, path: Path) -> _View: guard, canonical = self._adopt(handle, retain_root=True) if canonical != root: raise CommitUnavailable("drive aliases need reference validation") + if any(view.guard.volume == guard.volume for view in self._roots.values()): + # A serial is not a license to route a second drive's relative + # lookups through the first root handle (for example, cloned + # volumes or an additional DOS binding). Refuse ambiguity. + raise CapabilityUnavailable( + "duplicate volume binding needs reference validation" + ) location = (guard.volume, guard.file_id, ()) view = _View( canonical, diff --git a/cmake/ProtocyteOutputCoordinator.py b/cmake/ProtocyteOutputCoordinator.py index b5a125c..baebb6c 100644 --- a/cmake/ProtocyteOutputCoordinator.py +++ b/cmake/ProtocyteOutputCoordinator.py @@ -36,6 +36,10 @@ PROTOCOL_VERSION = 1 +# The retained consumer timing gate failed. Only isolated/mutation-forbidden +# qualification drivers override this in their own imported module instance. +# Neither a CLI option nor consumer configuration can promote the index. +_COMMITTED_INDEX_QUALIFIED = False PLAN_HEADER = "protocyte-output-plan-v1" GENERATED_SUFFIXES = (".protocyte.cpp", ".protocyte.hpp", "/runtime.hpp") @@ -1081,8 +1085,8 @@ def _load_observation_commit() -> Any: class OutputCoordinator: def __init__(self, lock_root: Path, *, registry_validation: str = "reference") -> None: - if registry_validation not in ("reference", "shadow", "native-shadow", "commit-shadow"): - _fail("registry validation must be reference or shadow (including native/commit-shadow)") + if registry_validation not in ("reference", "shadow", "native-shadow", "commit-shadow", "indexed"): + _fail("registry validation must be reference, indexed, or shadow (including native/commit-shadow)") self.lock_root = project_path(_require_absolute(lock_root, "output lock root")) self.registry_validation = registry_validation self.validation_metrics: dict[str, Any] = {} @@ -1505,14 +1509,23 @@ def _validate_registry( } self.validation_metrics = metrics preview_accepted: bool | None = None - if self.registry_validation == "commit-shadow": + index_allowed = self.registry_validation == "indexed" and _COMMITTED_INDEX_QUALIFIED + if self.registry_validation == "indexed" and not index_allowed: + metrics["index_authorization_blocked"] = True + metrics["fallback"] = "reference" + if self.registry_validation == "commit-shadow" or index_allowed: if progress is not None: progress.phase("validating provisional observation commit", "validation") started = time.perf_counter() try: - preview_accepted = self._preview_committed_index( - plans, retiring_root_keys or set(), progress=progress - ) + # Close markers on shared ancestors would otherwise invalidate + # simultaneous observers using different private registries. + # This lock coordinates observers only; it never substitutes + # for registry/generation/publication locks or filesystem checks. + with self._observation_lock(): + preview_accepted = self._preview_committed_index( + plans, retiring_root_keys or set(), progress=progress + ) metrics["preview_result"] = "accepted" if preview_accepted else "conflict" except Exception as error: # A failed or unsupported certificate grants no authority. The @@ -1523,7 +1536,24 @@ def _validate_registry( metrics["fallback"] = "reference" finally: metrics["preview_wall_seconds"] = time.perf_counter() - started - self._inject("after-observation-commit") + if self.registry_validation == "indexed": + if ( + preview_accepted is True + and metrics.get("commit_certificate") == "verified" + and metrics.get("commit_state") == "closed" + and type(metrics.get("commit_handles_opened")) is int + and type(metrics.get("commit_handles_closed")) is int + and metrics["commit_handles_opened"] > 0 + and metrics.get("commit_handles_opened") == metrics.get("commit_handles_closed") + ): + metrics["authoritative"] = "index" + metrics["reference_result"] = "not-required" + return + # Reference decides conflicts and all unverified/capability + # cases, retaining its diagnostics and upgrade behavior. + metrics["fallback"] = "reference" + else: + self._inject("after-observation-commit") if progress is not None: progress.phase("validating registry (reference authority)", "validation") if self.registry_validation == "native-shadow": @@ -1608,6 +1638,15 @@ def _validate_registry( "validator; no reconciliation changes were authorized" ) + def _observation_lock(self) -> Any: + if os.name != "nt": + return contextlib.nullcontext() + for name in ("LOCALAPPDATA", "TEMP", "TMP"): + value = os.environ.get(name) + if value and Path(value).is_absolute(): + return FileLock(Path(value) / "protocyte" / "observation-commit-v1.lock") + _fail("native observation coordination is unavailable") + def _preview_committed_index( self, plans: Sequence[Plan], retiring_root_keys: set[str], *, progress: _ReconcileProgress | None = None, @@ -1631,7 +1670,10 @@ def _preview_committed_index( if plans and scope.record_exists(roots): if scope.project(roots) != roots: _fail("provisional commit found an unsafe registry path") - for name in scope.list_names(roots): + state_names = scope.list_names(roots) + if progress is not None: + progress.registry(states=len(state_names)) + for name in state_names: if not _is_sha256(name): _fail("provisional commit found an unsafe registry entry") state = roots / name @@ -1639,7 +1681,9 @@ def _preview_committed_index( _fail("provisional commit found a changed registry entry") names = scope.list_names(state, relevant=frozenset(("claim.json", "plan.json"))) if "claim.json" not in names: - continue + # Reference owns abandoned-initialization cleanup. Do + # not silently change its recovery behavior on upgrade. + raise module.CapabilityUnavailable("unclaimed state requires reference cleanup") source = state / "claim.json" claim = _load_json(source, "output claim", _filesystem=scope) self._validate_claim_shape(claim, source) @@ -1654,6 +1698,7 @@ def _preview_committed_index( entries.append((model.Reservation("staging", key, build, target.identity, scope.facts(target.staging)), target.staging, scope.is_stable(target.staging))) metrics["commit_claims_checked"] += 1 if progress is not None: + progress.registry(claim=True) progress.phase(f"provisional observation commit ({metrics['commit_claims_checked']} claims)", "validation") index = module.ProvisionalOwnershipIndex(model, scope, entries) for plan in plans: @@ -2609,6 +2654,9 @@ def _parse_arguments(arguments: Sequence[str]) -> argparse.Namespace: parser.add_argument( "--experimental-observation-commit", action="store_true", help=argparse.SUPPRESS ) + parser.add_argument( + "--experimental-committed-index", action="store_true", help=argparse.SUPPRESS + ) return parser.parse_args(arguments) @@ -2623,12 +2671,15 @@ def main(arguments: Sequence[str] | None = None) -> int: return 0 if options.lock_root is None: _fail(f"{options.command} requires --lock-root") - if sum((options.experimental_native_observation, options.experimental_registry_index, options.experimental_observation_commit)) > 1: + if sum((options.experimental_native_observation, options.experimental_registry_index, options.experimental_observation_commit, options.experimental_committed_index)) > 1: _fail("choose one experimental validation mode") + if options.experimental_committed_index and not _COMMITTED_INDEX_QUALIFIED: + _fail("committed index is not qualified for consumer use; reference validation is required") coordinator = OutputCoordinator( options.lock_root, registry_validation=( - "commit-shadow" if options.experimental_observation_commit + "indexed" if options.experimental_committed_index + else "commit-shadow" if options.experimental_observation_commit else "native-shadow" if options.experimental_native_observation else "shadow" if options.experimental_registry_index else "reference" ), diff --git a/docs/consumer-validation-results.json b/docs/consumer-validation-results.json new file mode 100644 index 0000000..5ee262c --- /dev/null +++ b/docs/consumer-validation-results.json @@ -0,0 +1,2206 @@ +{ + "date": "2026-11-16", + "branch": "codex/experimental-generation-engine", + "starting_commit": "0fe8ad4", + "privacy": "anonymous retained consumer; no raw manifest, path, token, output name, ledger, journal name, or log is published", + "promotion": { + "required_all_validation_seconds": 30, + "reliable_under_30_seconds": false, + "decision": "do not promote", + "default": "reference", + "production_index_authorization_qualified": false, + "consumer_cli_cannot_enable_index": true, + "qualification_override": "only isolated fixture modules or mutation-forbidden read-only consumer validation" + }, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "git_normalized_implementation_files": { + "ProtocyteOutputCoordinator.py": "78d38996c8c39c38b232142ed8578a663227e10f16c02a8e6bfca4a07c3b52be", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "source_normalization": { + "difference": "CRLF to LF only", + "files": [ + "ProtocyteOutputCoordinator.py" + ], + "all_four_ast_identical": true, + "staged_sources_verified": true + }, + "historical_log": { + "validation_seconds": 751.875, + "lock_wait_seconds": 0.328, + "reconciliation_seconds": 1.969, + "total_seconds": 754.172, + "registry_entries": 2172, + "current_plans": 11, + "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85" + }, + "workload": { + "registry_entries": 2239, + "additional_claims_since_historical_run": 67, + "current_plans": 11, + "targets_per_plan": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "declared_outputs": 232, + "ledger_records": 4478, + "ntfs_volumes": 2, + "python": "3.12.9", + "windows_build": 26300, + "original_live_registry_and_locks": true, + "frozen_ledger_matches_first_and_final_capture": true, + "cold_os_cache_claimed": false, + "cache_or_security_settings_changed": false + }, + "reference_oracles": [ + { + "mode": "legacy-reference", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85" + }, + "index_authorization_enabled": false, + "result": "accepted", + "registry_entries": 2239, + "claims_checked": 2239, + "validation_seconds": 785.3106262999936, + "validation_cpu_seconds": 605.984375, + "frozen_ledger": true, + "original_output_paths": true, + "original_namespace_checked_separately": true, + "live_shared_lock_held": false, + "ownership_or_output_mutations": 0 + }, + { + "mode": "reference", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "index_authorization_enabled": false, + "result": "accepted", + "registry_entries": 2239, + "claims_checked": 2239, + "validation_seconds": 595.7590653999941, + "validation_cpu_seconds": 445.328125, + "frozen_ledger": true, + "original_output_paths": true, + "original_namespace_checked_separately": true, + "live_shared_lock_held": false, + "ownership_or_output_mutations": 0 + } + ], + "initial_strict_candidates": [ + { + "mode": "candidate", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 17.61311289999867, + "validation_cpu_seconds": 15.453125, + "plan_parse_seconds": 0.09259309998014942, + "lock_wait_seconds": 0.247461499995552, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "consumer-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 718656, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979 + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "candidate", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 17.446612500061747, + "validation_cpu_seconds": 15.28125, + "plan_parse_seconds": 0.09272740001324564, + "lock_wait_seconds": 0.15991239994764328, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "consumer-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719056, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979 + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "candidate", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 17.31433070008643, + "validation_cpu_seconds": 15.546875, + "plan_parse_seconds": 0.11862260004272684, + "lock_wait_seconds": 0.22342150000622496, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "consumer-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 718736, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979 + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "candidate", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 16.887565499986522, + "validation_cpu_seconds": 15.0, + "plan_parse_seconds": 0.08406679995823652, + "lock_wait_seconds": 0.1682880000444129, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "consumer-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 718816, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979 + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "candidate", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 16.806976999971084, + "validation_cpu_seconds": 14.859375, + "plan_parse_seconds": 0.09498679998796433, + "lock_wait_seconds": 0.18852690001949668, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "consumer-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 718976, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979 + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + } + ], + "first_live_strict_candidate": { + "scope": "anonymous original consumer configuration; original live namespace; no reconciliation authority", + "mode": "read-only-candidate", + "current_plans": 11, + "target_counts": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "output_count": 232, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" + }, + "plan_parse_seconds": 0.1472698000143282, + "index_authorization_enabled": false, + "lock_wait_seconds": 0.2867827999871224, + "registry_entries": 2239, + "result": "accepted", + "validation_seconds": 25.715632600011304, + "validation_cpu_seconds": 21.265625, + "native_metrics": { + "mode": "consumer-candidate-only", + "authoritative": "none", + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 720736, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979 + }, + "claims_and_plans_unchanged": true, + "tokens_produced": 0, + "reconciliation_authorized": false + }, + "integrated_gate": { + "scope": "entire production validation entry point, parsing and plan-set checks included; no reference pass, reconciliation, tokens or output writes", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "samples": [ + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 26.174323499959428, + "validation_cpu_seconds": 20.78125, + "plan_parse_seconds": 0.11409639997873455, + "lock_wait_seconds": 0.3012814000248909, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 25.34356820001267, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 720336, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 35.603824500052724, + "validation_cpu_seconds": 28.03125, + "plan_parse_seconds": 0.08776360005140305, + "lock_wait_seconds": 0.26508110004942864, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 34.69687200000044, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 728816, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 39.80337069998495, + "validation_cpu_seconds": 30.5625, + "plan_parse_seconds": 0.11223809997318313, + "lock_wait_seconds": 0.5415107000153512, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 37.12091679999139, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 721136, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 36.97771129995817, + "validation_cpu_seconds": 30.28125, + "plan_parse_seconds": 0.15987639996455982, + "lock_wait_seconds": 0.4058109000325203, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 35.323619100032374, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 720176, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 40.635606099967845, + "validation_cpu_seconds": 31.46875, + "plan_parse_seconds": 0.20475819997955114, + "lock_wait_seconds": 0.38760140002705157, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 38.474822300020605, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 728496, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 41.542352200020105, + "validation_cpu_seconds": 31.265625, + "plan_parse_seconds": 0.14437210001051426, + "lock_wait_seconds": 0.29777459998149425, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 40.36508209997555, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 729456, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 31.042304800008424, + "validation_cpu_seconds": 25.015625, + "plan_parse_seconds": 0.1883442000253126, + "lock_wait_seconds": 0.46938560000853613, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 29.291116799984593, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 720336, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 27.057863000023644, + "validation_cpu_seconds": 21.34375, + "plan_parse_seconds": 0.1810702999937348, + "lock_wait_seconds": 0.30401149997487664, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 25.882735699997284, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719776, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 27.432832800026517, + "validation_cpu_seconds": 21.234375, + "plan_parse_seconds": 0.24761989997932687, + "lock_wait_seconds": 0.3651012000045739, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 26.08510019996902, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 722096, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 25.667929299990647, + "validation_cpu_seconds": 20.78125, + "plan_parse_seconds": 0.2507786999922246, + "lock_wait_seconds": 0.2669615999911912, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 24.369054599956144, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719376, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + } + ], + "all_validation_seconds": [ + 26.174323499959428, + 35.603824500052724, + 39.80337069998495, + 36.97771129995817, + 40.635606099967845, + 41.542352200020105, + 31.042304800008424, + 27.057863000023644, + 27.432832800026517, + 25.667929299990647 + ], + "minimum_seconds": 25.667929299990647, + "median_seconds": 33.323064650030574, + "maximum_seconds": 41.542352200020105, + "under_30_seconds": 4, + "over_or_equal_30_seconds": 6, + "speedup_vs_751_875_median": 22.563200830908876, + "reduction_vs_751_875_median_percent": 95.56800470157532, + "speedup_vs_751_875_worst": 18.098999218432223, + "speedup_vs_700_median": 21.006471264021563, + "reduction_vs_700_median_percent": 95.23956219285277 + }, + "final_guarded_read_only_smoke_samples": [ + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 25.793771799944807, + "validation_cpu_seconds": 20.4375, + "plan_parse_seconds": 0.10730999999213964, + "lock_wait_seconds": 0.1914585000486113, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 24.998205800016876, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 718896, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 22.101702600019053, + "validation_cpu_seconds": 18.171875, + "plan_parse_seconds": 0.2061614000122063, + "lock_wait_seconds": 0.29463449999457225, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 20.858484099968337, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 720496, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "qualification_driver_sha256": "0bdf79601ec461097ef7dd6fd4059d618af60e6c8767b17168c65fc479c7d3b2", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 25.056636399938725, + "validation_cpu_seconds": 20.671875, + "plan_parse_seconds": 0.10060959996189922, + "lock_wait_seconds": 0.18200520001119003, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 24.17838270001812, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719296, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + } + ], + "unqualified_parallel_experiment": { + "production_scheduling_changed": false, + "workers": 4, + "trials": [ + { + "prototype": "parallel negative comparisons; production source unchanged; mutation forbidden", + "workers": 4, + "prototype_sha256": "219b5f5285a6b0f26bfe3ee55ba4b181fbdf3ad5ce296d3fa45aca85af314f7f", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "result": "accepted", + "validation_seconds": 24.28378179995343, + "validation_cpu_seconds": 28.609375, + "plan_parse_seconds": 0.10794779995921999, + "lock_wait_seconds": 0.2210819000029005, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 23.405751799989957, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 721776, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "prototype": "parallel negative comparisons; production source unchanged; mutation forbidden", + "workers": 4, + "prototype_sha256": "219b5f5285a6b0f26bfe3ee55ba4b181fbdf3ad5ce296d3fa45aca85af314f7f", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "result": "accepted", + "validation_seconds": 16.79476949997479, + "validation_cpu_seconds": 22.265625, + "plan_parse_seconds": 0.07279780000681058, + "lock_wait_seconds": 0.1466507000150159, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 16.17461909999838, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719376, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + } + ], + "paired_serial": { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "qualification_driver_sha256": "e959178ea2880fdf0661db18be384aba23ae6ef1386e630ebf80a6308220d40b", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 21.647801499988418, + "validation_cpu_seconds": 18.5, + "plan_parse_seconds": 0.098663899989333, + "lock_wait_seconds": 0.21336120000341907, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 20.880577100033406, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 718496, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + "limitation": "Private read-only prototype only; not promoted, not a ten-run gate, and not a substitute for worker teardown, exception, metric synchronization and platform qualification." + }, + "final_smoke_does_not_reset_failed_gate": "No performance optimization changed the native helper after the ten-run gate; quiet smoke samples verify the closed promotion guard and read-only override only.", + "profile": { + "separate_from_unprofiled_gate": true, + "receipt": { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 29.81850430002669, + "validation_cpu_seconds": 25.40625, + "plan_parse_seconds": 0.109815800038632, + "lock_wait_seconds": 0.26832329999888316, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 28.773140899953432, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719136, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + "profiler_total_seconds": 30.201925199999994, + "negative_probe_calls": 261703, + "negative_probe_internal_seconds": 15.791406, + "negative_probe_cumulative_seconds": 15.8716688, + "fraction_of_profile_total": 0.5228609068934454 + }, + "preservation_audits": [ + { + "mode": "audit", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "index_authorization_enabled": false, + "registry_entries": 2239, + "committed_output_files_checked": 232, + "claims_plans_snapshots_outputs_and_mtimes_unchanged": true, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "audit", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "qualification_driver_sha256": "0bdf79601ec461097ef7dd6fd4059d618af60e6c8767b17168c65fc479c7d3b2", + "index_authorization_enabled": false, + "registry_entries": 2239, + "committed_output_files_checked": 232, + "claims_plans_snapshots_outputs_and_mtimes_unchanged": true, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "audit", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "qualification_driver_sha256": "e959178ea2880fdf0661db18be384aba23ae6ef1386e630ebf80a6308220d40b", + "index_authorization_enabled": false, + "registry_entries": 2239, + "committed_output_files_checked": 232, + "claims_plans_snapshots_outputs_and_mtimes_unchanged": true, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "audit", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "qualification_driver_sha256": "e959178ea2880fdf0661db18be384aba23ae6ef1386e630ebf80a6308220d40b", + "index_authorization_enabled": false, + "registry_entries": 2239, + "committed_output_files_checked": 232, + "claims_plans_snapshots_outputs_and_mtimes_unchanged": true, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + } + ], + "upgrade": { + "scope": "isolated Windows cross-version checks; no consumer registry accessed", + "legacy_git_blob": "25f1660190d3d1015fef3955814c8c737bd686c5", + "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", + "candidate_coordinator_sha256": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "candidate_helper_sha256": { + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" + }, + "unchanged_ast_methods_since_checkpoint": [ + "reconcile_set", + "_reconcile_locked", + "validate", + "publish", + "reset", + "_recover", + "_apply_pending", + "_publish_one", + "_initialize_claim_locked", + "_release_claim", + "_generation_lock", + "_publication_lock" + ], + "reference_validator_ast_unchanged_since_checkpoint": false, + "file_lock_ast_unchanged_since_checkpoint": true, + "passed_cases": 91, + "production_index_authorization_qualified": false, + "index_authority_enabled_only_in_isolated_fixture_module": true, + "indexed_validations": 16, + "index_authorized_validations": 15, + "indexed_reference_fallbacks": 1, + "cases": [ + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "reference", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "reference", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "shadow", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "native-shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "native-shadow", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "commit-shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "commit-shadow", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "indexed", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "indexed", + "reader": "old", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + } + ] + }, + "unchanged_ast_methods_since_starting_commit": [ + "reconcile_set", + "_reconcile_locked", + "validate", + "publish", + "reset", + "_recover", + "_apply_pending", + "_publish_one", + "_initialize_claim_locked", + "_release_claim", + "_generation_lock", + "_publication_lock", + "_validate_registry_reference" + ], + "verification": { + "python_314_full_suite": { + "passed": 1863, + "skipped": 41 + }, + "python_312_targeted_suite": { + "passed": 137 + }, + "guarded_indexed_coordinator_suite": { + "passed": 89, + "skipped": 6 + }, + "cmake_before_final_guard": { + "passed": 21, + "skipped": 1 + }, + "relocated_install_after_final_guard": { + "passed": 5 + }, + "cross_version_cases": 91, + "no_cpp_files_edited": true + }, + "verification_notes": [ + "Three backend-specific fault injections were extended to the native backend; all indexed coordinator tests then passed.", + "An existing formatter test failed its 0.5-second grandchild startup assumption. Its fixture now gives startup margin and releases descendants after timeout while preserving the process-tree termination assertion; two targeted reruns and two complete suites passed afterward.", + "One extra smoke trial was discarded when a driver fingerprint changed during an edit. A replacement trial completed with frozen sources; discarded timing is not included." + ], + "limits": [ + "ten-run timing gate failed in six samples; normal consumers retain reference validation", + "warm/reused OS cache and inputs; no cold-cache guarantee", + "long original and branch references ran concurrently on frozen ledger copies with real geometry and separate original namespace checks; timings are descriptive", + "native semantics qualified on one Windows/NTFS host, not every filter or Windows version", + "ordinary cooperative registry writer model and fresh mutation-time guards remain required", + "unknown, dirty, missing, trimmed or over-budget witnesses require reference fallback" + ] +} diff --git a/docs/consumer-validation-results.md b/docs/consumer-validation-results.md new file mode 100644 index 0000000..c56c3bc --- /dev/null +++ b/docs/consumer-validation-results.md @@ -0,0 +1,165 @@ +# Retained consumer qualification + +This report uses an anonymous retained consumer configuration, not a synthetic +replacement. Raw manifests, logs, claim tokens, ledger copies, paths, and output +names stay in ignored local evidence. **Promotion failed:** six of ten complete +integrated validations exceeded 30 seconds. The default remains reference, and +an explicit source guard prevents consumer commands or the private API from +granting index authority. The success path is exercised only in isolated tests +or the mutation-forbidden read-only qualification harness. + +## Workload identity and scope + +The retained configure log contains the exact original measurement: +**751.875 seconds validation**, 0.328 seconds lock wait, 1.969 seconds +reconciliation, and 754.172 seconds total. It identifies 2,172 registry claims +and 11 current plans. The cached coordinator's SHA-256 is +`2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85`, +matching the pinned public source used by the upgrade qualification. + +The same configuration still has 11 current plans, one target each, and 232 +declared generated files. The shared v1 registry now contains **2,239 claims**, +67 more than the historical run, and **4,478 claim/plan records**. The extra +records are retained and checked. No registry was reset, pruned, split, or +replaced. Measurements use CPython 3.12.9 on Windows, with native observations +on two NTFS volumes. + +Two distinct read-only procedures keep the live consumer usable: + +- Candidate and integrated indexed validation acquire the original registry, + generation, and publication locks in their original order and validate the + complete live registry against the original current plans. +- Slow reference oracles operate on byte-identical ledger copies captured under + those locks. Their claim payloads still refer to the real output, build, and + staging paths. Each oracle also executes the original lock-namespace checks + separately. The full copied-ledger pass filters no foreign records. It does + not hold the shared consumer lock for several minutes. + +The helper rejects ownership/output mutation attempts. It never reconciles, +publishes, resets, produces a claim token, or changes production defaults. A +separate preservation audit checks original claim/plan bytes, current snapshots, +generated file hashes, and generated file mtimes. +Source roots, states, and record files must be ordinary non-reparse objects; +capture rejects unsafe source topology rather than copying it into a clean tree. +Native validation posts the counted USN metadata witnesses described in the +contract; read-only here refers to ownership records and generated content. + +## Final integration decision + +The ten fresh-process integrated samples were **26.174, 35.604, 39.803, 36.978, +40.636, 41.542, 31.042, 27.058, 27.433, and 25.668 seconds**. All accepted the +same complete live ledger with verified end witnesses, no reference pass, and +balanced handles. Only **4/10** were below 30 seconds. The median was +**33.323 seconds**, and the worst was **41.542 seconds**. + +Relative to the exact historical 751.875-second measurement, the median is +**22.56 times faster (95.57% less time)** and the worst is 18.10 times faster. +Relative to an approximate 700-second baseline, the median is 21.01 times faster +(95.24% less time). These are descriptive comparisons across different runs, +not controlled claims about the algorithm alone. They describe the proposed +indexed path, not a speedup delivered by the unchanged reference default. + +One separate cProfile run attributed **15.791 of 30.202 profiled seconds** to +the **261,703 fresh negative probes**. Each unprofiled gate sample retained +84,579 fresh reservation comparisons, two full registry inventories, 17,958 +close posts, 8,979 exact end witnesses, and all 26,916 handle closes. Alternate +fresh root-relative lookup microbenchmarks did not establish enough improvement +to close the observed timing gap reliably; no alternate API was shipped. +Caching negative results would remove a correctness check and remains rejected. + +A separate read-only prototype scheduled independent fresh comparisons on four +workers, joining them before seal or handle release. It preserved all 261,703 +negative probes and verified every witness. Its two runs took **24.284 and +16.795 seconds**; the paired serial run took **21.648 seconds**. The second +parallel run used **22.266 CPU seconds**, versus 18.500 for the paired serial +run. This is promising feasibility evidence, with additional CPU cost, not a +completed reliability or concurrency qualification. Production scheduling was +not changed. Worker teardown, exceptional exits, counter synchronization, and +the complete timing gate need evidence before adopting it. + +After the failed series, the final source added the closed promotion guard. +Extra guarded read-only smoke samples check that prototype path and the final +preservation audit. No performance change follows the failed series: the native +helper is byte-identical. Those quieter samples do not reset the failed timing +history or justify enabling the index. Full per-run metrics, exact as-run and +Git-normalized source fingerprints, and preservation receipts are retained in +[the anonymous JSON report](consumer-validation-results.json). + +## Completed reference and candidate checks + +| Measurement | Validation wall time | Result | +| --- | ---: | --- | +| Historical original consumer log, 2,172 claims | 751.875 s | Accepted | +| Exact original source, frozen 2,239-claim ledger | 785.311 s | Accepted | +| Branch reference validator, same frozen ledger | 595.759 s | Accepted | +| First strict native candidate, live 2,239-claim ledger | 25.716 s | Verified, accepted | +| Five subsequent fresh-process strict candidates, live ledger | 17.613, 17.447, 17.314, 16.888, 16.807 s | All verified, accepted | + +The two long reference measurements overlapped; their timings describe those +runs rather than a controlled speed comparison. Their purpose is complete +oracle agreement on the retained workload. The candidate times include current +plan parsing, current-plan set checks, all record authentication, index +construction, fresh missing-path comparisons, final inventories and bindings, +USN versions, exact end witnesses, and handle release. Lock wait is separate. +They exclude reconciliation and an additional reference pass. + +These initial runs precede the final observer coordination and duplicate-volume +hardening. Their exact source fingerprints remain in the machine-readable +report. They are feasibility evidence, not final-source promotion evidence. +Each invocation builds a new read set and reauthenticates every record. The +workload and OS caches are reused; no cold-cache claim is made and no cache or +security setting was changed. + +## Correctness and upgrade boundaries + +The [observation contract](observation-commit-contract.md) explains which native +facts are certified. Existing positive paths require exact canonical spelling; +missing paths are freshly checked in both comparison directions and at seal. +Relevant mutations must change the saved version or make the exact forced end +record dirty. Native tests inject rename, record-content, and attribute-only +reparse ABA changes after the last version read, verifying that end witnesses +close that gap. Tests retain the unjournaled case-mode counterexample. + +When enabled only inside qualification, the integrated path can return index +authority only after a verified seal and complete handle release. Incomplete +or inconsistent metrics grant no authority. +Conflicts and unavailable, changed, malformed, or over-budget observations run +the reference validator, preserving its diagnostics. Abandoned state uses the +reference cleanup path. A per-user observer mutex prevents independent new +observers from invalidating common-ancestor markers; it is released before +reference fallback and never replaces the existing ownership locks. Duplicate +volume serials reached through another drive binding force fallback. + +No facts cross into initialization, recovery, publication, reset, or another +invocation. Those mutation methods and the ownership locks remain unchanged. +Protocol v1, record encodings, tokens, and recovery formats need no migration. +The independent recorded-plan metadata fix rejects dangling links and metadata +errors instead of silently skipping retained state; valid users need no reset. + +## Reproduction and privacy + +Verification passed: **1,863 default tests** (41 platform/capability skips), +**137 minimum-Python checks**, **89 indexed coordinator tests** (6 platform +skips), **91 old/new upgrade and crash-recovery cases**, and **21 CMake checks** +(1 platform skip), followed by **5 final-source relocated-install checks**. +The latter include default operation and rejection of the unqualified index +flag. Upgrade fixtures exercised 15 native acceptances and one recovery-state +fallback. A formatter test's reproduced startup assumption was replaced with +startup margin and a descendant release handshake, retaining its timeout and +tree-termination assertions; the complete suite passed afterward. + +Use [the qualification helper](../tests/verify_consumer_registry.py) with a +private JSON manifest containing `registry`, `current_plans`, empty +`retired_plans`, and `legacy_coordinator` paths. Run `capture` into a new private +work directory, then `candidate`, `indexed`, `reference`, `legacy-reference`, +and `audit` as needed. The indexed mode exercises the production validation +entry point and requires index authority with no reference pass. +It overrides the closed promotion guard only in its own imported module, after +disabling all reconciliation, recovery, publication, reset, and mutation entry +points. A failed candidate aborts the live trial rather than blocking the +consumer for a slow reference pass; full reference fallback is checked separately. + +Publish only sanitized `*-results.json` receipts. `preservation.private.json`, +`ledger/`, `inputs/`, raw logs, and the manifest contain private data and must +remain local. The frozen-reference tests verify both original-namespace and +foreign-staging rejection so copying the ledger cannot omit those checks. diff --git a/docs/observation-commit-contract.md b/docs/observation-commit-contract.md index 20a8b25..daa5a74 100644 --- a/docs/observation-commit-contract.md +++ b/docs/observation-commit-contract.md @@ -1,15 +1,21 @@ # Experimental observation commit -Status: private `commit-shadow` experiment on -`codex/experimental-generation-engine`. Reference validation remains the only -authority. The default and the CMake consumer commands do not select this mode. +Status: experimental `commit-shadow` and `indexed` integrations on +`codex/experimental-generation-engine`. The +[retained consumer qualification](consumer-validation-results.md) failed the +reliable-under-30-second timing gate. The default remains reference validation. +An explicit source guard blocks consumer index authority, including the private +API and CLI. Isolated fixtures and the mutation-forbidden read-only harness can +exercise the proposed indexed success path; it accepts only a verified, fully +closed read set. Other outcomes use reference validation. This replaces the previous fresh-observation experiment's repeated full path walks with a provisional read set. Its certificate verifies the requested native object/version witnesses; it is not unconditional namespace authority. The read -set is discarded before the ordinary reference validation and -before any reconciliation mutation. There is no persistent filesystem cache, -new claim format, new lock namespace, watcher, service, or privileged setup. +set is discarded before reference fallback or an indexed acceptance, and before +any reconciliation mutation. There is no persistent filesystem cache, new claim +format, change to the ownership lock namespace, watcher, service, or privileged +setup. A separate observer mutex coordinates the journal markers described below. ## Scope and dependencies @@ -29,7 +35,9 @@ validator. A missing capability never requests administrator access or a user configuration change. Windows object identity consists of the volume serial and the full 128-bit file -ID. Every positive path component is observed through a short root-relative +ID. Reaching a second drive with an already observed volume serial forces +reference fallback, preventing ambiguous root-handle routing. Every positive +path component is observed through a short root-relative native open with `OBJ_DONT_REPARSE`. Only volume-root handles survive a lookup; ordinary build, staging, registry, and record handles are promptly closed, with read/write/delete sharing. A competing cleanup can delete an observed directory; @@ -67,7 +75,9 @@ file's USN. The inference used here is that a relevant NTFS mutation during an object's observation interval either changes its version or appears among the forced end record's reasons. The native tests exercise rename, content/timestamp, and attribute-only reparse ABA changes, including a preexisting writer primed -with the same reason before registration. +with the same reason before registration. Additional tests inject those changes +after the last version read but before the end close is posted: the dirty end +record must reject a change that the preceding version read could not see. An adversarial native test found a counterexample to treating **all** metadata as versioned: changing a directory's case-sensitivity flag and changing it back @@ -86,12 +96,17 @@ Microsoft describes the lookup behavior under the directory flag in This argument covers the anchored NTFS objects. DOS-device mappings are outside the NTFS journal: reopening each drive at seal checks its final binding, not -whether it was temporarily remapped and restored. Likewise, reading canonical -record bytes under the registry lock retains the reference implementation's -cooperative-writer model; it does not claim an atomic data snapshot against -unsynchronized memory-mapped writers. These namespace and writer boundaries -must be reviewed before a certificate could replace reference validation. No -current certificate bypasses that validation. +whether it was temporarily remapped and restored. After each root is bound, all +lookups and refreshed negatives use its retained volume-root handle, so a +temporary DOS remapping cannot supply cached geometry from another volume. +Final bindings must still match. Later mutation checks resolve their paths +afresh under the unchanged v1 rules. + +Reading canonical record bytes under the registry lock retains the reference +implementation's cooperative-writer model; it does not claim an atomic data +snapshot against unsynchronized memory-mapped writers. The v1 writer protocol +uses the same existing locks and durable record operations. This is a retained +trust boundary, not a new guarantee about arbitrary external writers. Sources for that inference: @@ -106,9 +121,10 @@ epoch queries and unprivileged reads whose names are redacted. The implementatio uses the public V2/V3 record headers and requires positive coverage of every exact marker. It never treats the absence of an event in this filtered transport as evidence that nothing changed. A transport that omits a required marker -cannot produce a certificate. This capability and the relevant mutation-to-USN -semantics still require qualification on the supported Windows/NTFS matrix -before any authoritative mode is considered. +cannot produce a certificate. Native mutation tests qualify the relevant +semantics on the measured Windows/NTFS host. This does not claim a test matrix +covering every Windows build, filesystem filter, or security product; capability +failures or unverified replies on another installation use reference validation. ## Missing paths are not indexed as stable @@ -132,8 +148,11 @@ As with the reference validator's successive fresh probes, absence can change between system calls. This experiment does not claim an atomic snapshot or a namespace freeze. Its goal is to justify cached **positive** geometry during the calculations while preserving fresh negative checks. Existing mutation-time -checks remain necessary. A future authoritative design must define the boundary -between a successful past computation and each subsequent mutation explicitly. +checks remain necessary. The integration's boundary is a completed past +validation computation: seal has verified the positive intervals, all native +handles have been released, and the read set has been erased before the caller +can enter the unchanged reconciliation and mutation methods. There is no new +claim that namespace stability persists after validation returns. ## Expiry, fallback, and operational costs @@ -141,17 +160,24 @@ Instances are local to one validation phase. Sealing disables further reads; closing releases roots and clears all observations, locators, inventories, and object tables. No certificate or path facts cross into claim initialization, recovery, publication, reset, or the next invocation. A failed or unsupported -commit still runs the ordinary reference validator. A verified candidate -conflict followed by reference acceptance fails closed before reconciliation. +commit still runs the ordinary reference validator. Indexed conflicts also use +reference validation, preserving its diagnostics and acceptance behavior. +`commit-shadow` additionally treats a verified candidate conflict followed by +reference acceptance as a disagreement and fails closed. The experiment posts journal metadata records on observed objects, including common ancestors. It does not modify their contents or namespace. These posts are real filesystem work and are included in timing and operation counters. They can invalidate another observer's saved versions even when neither changed the geometry. Same-registry operations already serialize through the existing -lock; independent private registries can still collide on common ancestors. -Such collisions conservatively fall back to reference validation. No additional -production mutex was added to conceal this reliability limitation. +lock. New observers in independent registries additionally share a per-user +`observation-commit-v1.lock` beneath the ordinary user cache (or temporary +directory fallback). It is acquired inside the existing ownership locks and +released before reference fallback or mutation. No additional ownership lock is +acquired while it is held, so it introduces no reverse lock-order dependency. +It changes neither registry identity nor old/new ownership exclusion. Other +users, older prototypes, or external marker writers can still invalidate a +candidate; such collisions conservatively fall back to reference validation. Bounds are 32,768 unique objects, 16 MiB per ownership record, and 64 MiB of journal transport per volume. Exceeding them falls back. Metrics include native @@ -163,7 +189,10 @@ or tokens. An exception records its type, not its message. ## Upgrade contract and promotion gate -Normal installations continue to use reference validation. Packaging installs +Normal installations continue to use reference validation. Neither consumer +configuration nor the hidden experiment flag can override the closed promotion +guard. Only a future reviewed source change after qualification can promote it. +Packaging installs the additional trusted sibling Python helper, without requiring a new consumer command or runtime dependency. Protocol v1, plan serialization, claim tokens, lock locations, and recovery/publication formats are unchanged. Old and new @@ -178,8 +207,8 @@ problem to be repaired rather than being skipped. Promotion remains closed until all of the following have evidence: -- Relevant native mutation semantics and fallback behavior are qualified across - supported configurations; the remaining assumptions above are reviewed. +- Relevant native mutation semantics and fallback behavior are qualified for + the enabled capability, with the namespace and writer boundaries above explicit. - Differential, race, malformed-state, crash-recovery, packaging, minimum-Python, and old/new upgrade checks pass with the final source fingerprints. - **All validation**, including current plans, every retained record, fresh diff --git a/docs/observation-commit-results.md b/docs/observation-commit-results.md index 2360b9f..b8a9af6 100644 --- a/docs/observation-commit-results.md +++ b/docs/observation-commit-results.md @@ -1,5 +1,10 @@ # Observation commit experiment: results +This is the historical synthetic qualification at commit `0fe8ad4`. Its source +fingerprints and closed promotion decision are retained below. See the newer +[retained consumer qualification](consumer-validation-results.md) for subsequent +real-workload measurements and the current integration decision. + The index remains **disabled as an authority** on `codex/experimental-generation-engine`. The new read-set experiment has a safe shadow integration, useful native evidence, and passing upgrade checks. It has diff --git a/tests/test_consumer_registry_qualification.py b/tests/test_consumer_registry_qualification.py new file mode 100644 index 0000000..8ac69d8 --- /dev/null +++ b/tests/test_consumer_registry_qualification.py @@ -0,0 +1,180 @@ +from __future__ import annotations + +import importlib.util +import itertools +import json +import sys +from pathlib import Path + +import pytest + +_spec = importlib.util.spec_from_file_location( + "consumer_qualification_helpers", + Path(__file__).with_name("test_output_coordinator.py"), +) +assert _spec is not None and _spec.loader is not None +helpers = importlib.util.module_from_spec(_spec) +sys.modules[_spec.name] = helpers +_spec.loader.exec_module(helpers) +_spec = importlib.util.spec_from_file_location( + "consumer_qualification_driver", + Path(__file__).with_name("verify_consumer_registry.py"), +) +assert _spec is not None and _spec.loader is not None +driver = importlib.util.module_from_spec(_spec) +sys.modules[_spec.name] = driver +_spec.loader.exec_module(driver) +_modules = itertools.count() + + +def seeded(tmp_path: Path): + module = driver.load( + Path(__file__).resolve().parents[1] / "cmake/ProtocyteOutputCoordinator.py", + f"consumer_qualification_fixture_{next(_modules)}", + ) + input_file = tmp_path / "consumer.plan" + root, build = tmp_path / "generated", tmp_path / "build" + target = helpers._target("consumer-qualification") + helpers._write_plan(input_file, root, build, ((target, "sample.protocyte.hpp"),)) + plan = module.Plan.read(input_file) + engine = module.OutputCoordinator( + tmp_path / "registry", registry_validation="reference" + ) + token = engine.reconcile(plan) + stage = plan.staging_for_target(target) / "generated" + helpers._stage(stage, "sample.protocyte.hpp", b"// original generated file\n") + engine.publish(plan, target, stage) + manifest = { + "registry": str(engine.lock_root), + "current_plans": [str(input_file)], + "retired_plans": [], + } + work = tmp_path / "qualification" + work.mkdir() + return module, engine, plan, target, token, manifest, work + + +def test_capture_and_reference_keep_original_data_and_redact_receipt( + tmp_path: Path, +) -> None: + module, engine, plan, _, token, manifest, work = seeded(tmp_path) + original = driver.ledger(engine.lock_root) + output = plan.root / "sample.protocyte.hpp" + before = output.read_bytes(), output.stat().st_mtime_ns + receipt = driver.capture(module, manifest, work) + checked = driver.reference(module, manifest, work) + assert checked["result"] == "accepted" and checked["claims_checked"] == 1 + assert receipt["committed_output_files_checked"] == 1 + assert receipt["claims_plans_snapshots_and_outputs_unchanged"] + assert driver.ledger(engine.lock_root) == original + assert (output.read_bytes(), output.stat().st_mtime_ns) == before + serialized = json.dumps({"capture": receipt, "reference": checked}) + assert str(tmp_path) not in serialized and token not in serialized + with pytest.raises(RuntimeError, match="ownership/output mutation"): + module._atomic_write(output, b"forbidden") + with pytest.raises(RuntimeError, match="ownership/output mutation"): + engine.reconcile(plan) + assert output.read_bytes() == before[0] + + +def test_frozen_reference_preserves_original_lock_namespace_rejection( + tmp_path: Path, +) -> None: + module, engine, _, _, _, manifest, work = seeded(tmp_path) + driver.capture(module, manifest, work) + dangerous = work / "inputs/000.plan" + helpers._write_plan( + dangerous, + engine.lock_root / "unsafe-generated", + tmp_path / "other-build", + ((helpers._target("unsafe-namespace"), "sample.protocyte.hpp"),), + ) + with pytest.raises(module.CoordinatorError, match="lock namespace"): + driver.reference(module, manifest, work) + + +def test_frozen_reference_checks_foreign_staging_reservations(tmp_path: Path) -> None: + module, _, plan, target, _, manifest, work = seeded(tmp_path) + driver.capture(module, manifest, work) + helpers._write_plan( + work / "inputs/000.plan", + plan.staging_for_target(target) / "intruder", + tmp_path / "intruder-build", + ((helpers._target("intruder"), "sample.protocyte.hpp"),), + ) + with pytest.raises(module.CoordinatorError, match="staging reserved"): + driver.reference(module, manifest, work) + + +def test_capture_rejects_output_corruption_without_repairing_it(tmp_path: Path) -> None: + module, engine, plan, _, _, manifest, work = seeded(tmp_path) + output = plan.root / "sample.protocyte.hpp" + output.write_bytes(b"// externally changed\n") + before = driver.ledger(engine.lock_root) + with pytest.raises(AssertionError, match="differs from committed snapshot"): + driver.capture(module, manifest, work) + assert output.read_bytes() == b"// externally changed\n" + assert driver.ledger(engine.lock_root) == before + + +def test_capture_rejects_foreign_state_link_before_copying_ledger( + tmp_path: Path, +) -> None: + module, engine, _, _, _, manifest, work = seeded(tmp_path) + path = tmp_path / "foreign.plan" + helpers._write_plan( + path, + tmp_path / "foreign-generated", + tmp_path / "foreign-build", + ((helpers._target("foreign"), "foreign.protocyte.hpp"),), + ) + foreign = module.Plan.read(path) + engine.reconcile(foreign) + state = engine._state_directory(foreign.root) + preserved = tmp_path / "preserved-foreign-state" + assert state.resolve().is_relative_to(tmp_path.resolve()) + assert preserved.resolve().is_relative_to(tmp_path.resolve()) + claim = (state / "claim.json").read_bytes() + state.rename(preserved) + helpers._directory_link(state, preserved) + with pytest.raises(AssertionError, match="unsafe source registry state"): + driver.capture(module, manifest, work) + assert (preserved / "claim.json").read_bytes() == claim + assert not (work / "ledger/roots").exists() + + +@pytest.mark.parametrize("failed_certificate", [False, True]) +def test_indexed_qualification_requires_mutation_guard_and_restores_promotion_gate( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, failed_certificate: bool +) -> None: + module, engine, _, _, _, manifest, work = seeded(tmp_path) + before = driver.ledger(engine.lock_root) + assert module._COMMITTED_INDEX_QUALIFIED is False + + def certificate(self, *args, **kwargs): + assert module._COMMITTED_INDEX_QUALIFIED is True + with pytest.raises(RuntimeError, match="ownership/output mutation"): + module._atomic_write(tmp_path / "forbidden", b"forbidden") + if failed_certificate: + raise RuntimeError("test certificate could not be verified") + self.validation_metrics.update( + commit_certificate="verified", + commit_state="closed", + commit_handles_opened=1, + commit_handles_closed=1, + commit_claims_checked=1, + ) + return True + + monkeypatch.setattr( + module.OutputCoordinator, "_preview_committed_index", certificate + ) + if failed_certificate: + with pytest.raises(RuntimeError, match="required reference fallback"): + driver.candidate(module, manifest, work, integrated=True) + else: + receipt = driver.candidate(module, manifest, work, integrated=True) + assert receipt["native_metrics"]["authoritative"] == "index" + assert module._COMMITTED_INDEX_QUALIFIED is False + assert driver.ledger(engine.lock_root) == before + assert not (tmp_path / "forbidden").exists() diff --git a/tests/test_observation_commit.py b/tests/test_observation_commit.py index c440cf9..7e1bdce 100644 --- a/tests/test_observation_commit.py +++ b/tests/test_observation_commit.py @@ -27,13 +27,15 @@ @pytest.fixture(autouse=True) -def quiet_native_commit_cases(request, tmp_path_factory): +def quiet_native_commit_cases(request, tmp_path_factory, monkeypatch): # Close-marker posts are deliberately treated as version changes, including # posts by another observer. Give quiet-baseline tests a private session gate; # the explicit overlap test below exercises invalidation instead. base = tmp_path_factory.getbasetemp() if getattr(request.config, "workerinput", None) is not None: base = base.parent + # Exercise the guarded success path only in isolated test fixtures. + monkeypatch.setattr(coordinator, "_COMMITTED_INDEX_QUALIFIED", True) with coordinator.FileLock(base / "observation-commit-tests.lock"): yield @@ -75,6 +77,24 @@ def test_redacted_record_headers_can_supply_exact_positive_witnesses( commit.verify_witnesses({100: 11}, records) +@pytest.mark.skipif(os.name != "nt", reason="DOS drive roots") +@pytest.mark.parametrize("same_root_id", [False, True]) +def test_second_drive_with_duplicate_volume_serial_cannot_reuse_first_root( + monkeypatch: pytest.MonkeyPatch, same_root_id: bool +) -> None: + scope = object.__new__(commit.WindowsObservationCommit) + scope._counts = defaultdict(int) + scope._roots = {"c:\\": SimpleNamespace(guard=SimpleNamespace(volume=77))} + scope.reader = SimpleNamespace( + _native_name=lambda path: None, _open_existing=lambda path: 123 + ) + guard = SimpleNamespace(volume=77, file_id=1 if same_root_id else 2) + monkeypatch.setattr(scope, "_adopt", lambda handle, **kwargs: (guard, Path("D:\\"))) + with pytest.raises(commit.CapabilityUnavailable, match="duplicate volume binding"): + scope._root(Path("D:/generated")) + assert list(scope._roots) == ["c:\\"] + + @pytest.mark.parametrize("reason", [0, 1, 0x200, 0x1000, 0x8000, 0x10000, 0x100000]) def test_close_witness_must_not_hide_pending_changes(reason: int) -> None: flags = 0 if reason == 0 else commit.CLOSE_REASON | reason @@ -228,8 +248,9 @@ def test_record_content_aba_with_restored_timestamp_invalidates( readset.seal() +@pytest.mark.parametrize("timing", ["before-seal", "after-version-read"]) def test_reparse_aba_from_a_preexisting_attribute_writer_cannot_certify( - tmp_path: Path, readset + tmp_path: Path, readset, monkeypatch: pytest.MonkeyPatch, timing: str ) -> None: from ctypes import wintypes as w @@ -292,17 +313,81 @@ def reparse(set_point: bool): reparse(True) reparse(False) readset.project(directory) - reparse(True) - reparse(False) + if timing == "before-seal": + reparse(True) + reparse(False) + else: + identity = readset.facts(directory).location[:2] + original_version = readset._version + changed = False + + def change_after_version(handle): + nonlocal changed + version = original_version(handle) + if not changed and readset._identity(handle) == identity: + changed = True + reparse(True) + reparse(False) + return version + + monkeypatch.setattr(readset, "_version", change_after_version) assert not directory.is_junction() - with pytest.raises(commit.ObservationChanged): + match = ( + "close witness contains accumulated changes" + if timing == "after-version-read" + else None + ) + with pytest.raises(commit.ObservationChanged, match=match): readset.seal() + if timing == "after-version-read": + assert changed finally: if directory.is_junction(): reparse(False) assert readset.reader._close(writer) +@pytest.mark.parametrize("mutation", ["rename-aba", "record-content-aba"]) +def test_native_close_witness_catches_changes_after_the_version_read( + tmp_path: Path, readset, monkeypatch: pytest.MonkeyPatch, mutation: str +) -> None: + path = tmp_path / "observed" + if mutation == "rename-aba": + path.mkdir() + readset.project(path) + guard = readset._view(path).guard + else: + path.write_bytes(b'{"value":1}\n') + readset.read_json(path, "test record") + guard = readset._view(path, leaf_may_be_file=True).guard + identity = guard.volume, guard.file_id + original_version = readset._version + changed = False + + def change_after_version(handle): + nonlocal changed + version = original_version(handle) + if not changed and readset._identity(handle) == identity: + changed = True + if mutation == "rename-aba": + moved = path.with_name("moved") + path.rename(moved) + moved.rename(path) + else: + original = path.stat() + path.write_bytes(b'{"value":2}\n') + path.write_bytes(b'{"value":1}\n') + os.utime(path, ns=(original.st_atime_ns, original.st_mtime_ns)) + return version + + monkeypatch.setattr(readset, "_version", change_after_version) + with pytest.raises( + commit.ObservationChanged, match="close witness contains accumulated changes" + ): + readset.seal() + assert changed + + @pytest.mark.parametrize("phase", ["comparison", "seal"]) def test_missing_component_creation_is_freshly_checked( tmp_path: Path, readset, phase: str @@ -527,8 +612,9 @@ def overlaps(self, first, second): "error", [commit.CapabilityUnavailable("no capability"), RuntimeError("unexpected failure")], ) +@pytest.mark.parametrize("mode", ["commit-shadow", "indexed"]) def test_unavailable_or_failed_commit_uses_reference_and_preserves_existing_token( - tmp_path: Path, monkeypatch: pytest.MonkeyPatch, error: Exception + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, error: Exception, mode: str ) -> None: engine = coordinator.OutputCoordinator( tmp_path / "locks", registry_validation="reference" @@ -542,7 +628,7 @@ def unavailable(*args, **kwargs): raise error monkeypatch.setattr(engine, "_preview_committed_index", unavailable) - engine.registry_validation = "commit-shadow" + engine.registry_validation = mode assert engine.reconcile(plan) == token assert (state / "claim.json").read_bytes() == claim_bytes assert engine.validation_metrics["fallback"] == "reference" @@ -568,7 +654,274 @@ def test_commit_conflict_disagreement_cannot_initialize_a_new_claim( @pytest.mark.parametrize( - "other_flag", ["--experimental-registry-index", "--experimental-native-observation"] + "certificate", + [ + {}, + {"commit_certificate": "verified", "commit_state": "closed"}, + { + "commit_certificate": "unverified", + "commit_state": "closed", + "commit_handles_opened": 2, + "commit_handles_closed": 2, + }, + { + "commit_certificate": "verified", + "commit_state": "sealed", + "commit_handles_opened": 2, + "commit_handles_closed": 2, + }, + { + "commit_certificate": "verified", + "commit_state": "closed", + "commit_handles_opened": 2, + "commit_handles_closed": 1, + }, + { + "commit_certificate": "verified", + "commit_state": "closed", + "commit_handles_opened": 0, + "commit_handles_closed": 0, + }, + { + "commit_certificate": "verified", + "commit_state": "closed", + "commit_handles_opened": 1, + "commit_handles_closed": True, + }, + ], +) +def test_indexed_incomplete_certificate_runs_reference_before_mutation( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, certificate: dict +) -> None: + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="indexed" + ) + plan = _plan(tmp_path, "current") + + def incomplete(*args, **kwargs): + engine.validation_metrics.update(certificate) + return True + + monkeypatch.setattr(engine, "_preview_committed_index", incomplete) + original = engine._initialize_claim_locked + + def initialize(state, current): + assert engine.validation_metrics["fallback"] == "reference" + assert engine.validation_metrics["reference_result"] == "accepted" + original(state, current) + + monkeypatch.setattr(engine, "_initialize_claim_locked", initialize) + assert engine.reconcile(plan) + + +def test_indexed_conflict_uses_reference_diagnostics_and_acceptance( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="indexed" + ) + monkeypatch.setattr( + engine, "_preview_committed_index", lambda *args, **kwargs: False + ) + retained = _plan(tmp_path, "retained") + assert engine.reconcile(retained) + assert engine.validation_metrics["reference_result"] == "accepted" + retained.root.touch() + with pytest.raises(coordinator.CoordinatorError, match="non-directory"): + engine.reconcile(_plan(tmp_path, "current")) + assert engine.validation_metrics["reference_result"] == "rejected" + assert len(list((engine.lock_root / "roots").glob("*/claim.json"))) == 1 + + +def test_failed_promotion_gate_blocks_api_and_cli_before_index_authority( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, capsys +) -> None: + monkeypatch.setattr(coordinator, "_COMMITTED_INDEX_QUALIFIED", False) + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="indexed" + ) + + def forbidden(*args, **kwargs): + pytest.fail("unqualified index was consulted") + + monkeypatch.setattr(engine, "_preview_committed_index", forbidden) + assert engine.reconcile(_plan(tmp_path, "current")) + assert engine.validation_metrics["index_authorization_blocked"] + assert engine.validation_metrics["authoritative"] == "reference" + assert engine.validation_metrics["reference_result"] == "accepted" + rejected = tmp_path / "unqualified-cli-locks" + assert ( + coordinator.main( + [ + "reconcile", + "--lock-root", + str(rejected), + "--experimental-committed-index", + ] + ) + == 1 + ) + assert "not qualified for consumer use" in capsys.readouterr().err + assert not rejected.exists() + + +@pytest.mark.skipif(os.name != "nt", reason="native commit witnesses require Windows") +def test_indexed_verified_readset_closes_before_mutation_without_reference( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, native_capability +) -> None: + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="reference" + ) + retained = [_plan(tmp_path, f"retained-{number}") for number in range(3)] + engine.reconcile_set((), retained) + engine.registry_validation = "indexed" + + def forbidden(*args, **kwargs): + pytest.fail("verified native read set unexpectedly ran reference") + + monkeypatch.setattr(engine, "_validate_registry_reference", forbidden) + original = engine._initialize_claim_locked + + def initialize(state, plan): + metrics = engine.validation_metrics + assert metrics["authoritative"] == "index" + assert metrics["commit_certificate"] == "verified" + assert metrics["commit_state"] == "closed" + assert metrics["commit_handles_opened"] == metrics["commit_handles_closed"] + assert metrics["commit_claims_checked"] == 3 + assert metrics["commit_records_read"] == 6 + original(state, plan) + + monkeypatch.setattr(engine, "_initialize_claim_locked", initialize) + assert engine.reconcile(_plan(tmp_path, "current")) + + +@pytest.mark.skipif(os.name != "nt", reason="native commit witnesses require Windows") +def test_indexed_abandoned_state_falls_back_to_reference_cleanup( + tmp_path: Path, native_capability +) -> None: + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="indexed" + ) + abandoned = engine.lock_root / "roots" / ("a" * 64) + abandoned.mkdir(parents=True) + (abandoned / "snapshot.json").write_bytes(b"{}") + assert engine.reconcile(_plan(tmp_path, "current")) + assert not abandoned.exists() + assert engine.validation_metrics["fallback"] == "reference" + assert engine.validation_metrics["reference_result"] == "accepted" + + +@pytest.mark.skipif(os.name != "nt", reason="native commit witnesses require Windows") +@pytest.mark.parametrize("replacement", ["file", "junction"]) +def test_indexed_success_keeps_fresh_mutation_time_path_guards( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch, native_capability, replacement: str +) -> None: + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="reference" + ) + engine.reconcile(_plan(tmp_path, "retained")) + current = _plan(tmp_path, "current") + outside = tmp_path / "outside" + outside.mkdir() + sentinel = outside / "sample.protocyte.hpp" + sentinel.write_bytes(b"// preserve external output\n") + engine.registry_validation = "indexed" + validate = engine._validate_registry + + def change_after_validation(*args, **kwargs): + validate(*args, **kwargs) + assert engine.validation_metrics["authoritative"] == "index" + assert engine.validation_metrics["commit_state"] == "closed" + if replacement == "file": + current.root.touch() + else: + helpers._directory_link(current.root, outside) + + monkeypatch.setattr(engine, "_validate_registry", change_after_validation) + with pytest.raises( + coordinator.CoordinatorError, match="non-directory|symbolic link or junction" + ): + engine.reconcile(current) + assert sentinel.read_bytes() == b"// preserve external output\n" + assert len(list((engine.lock_root / "roots").glob("*/claim.json"))) == 1 + + +@pytest.mark.skipif(os.name != "nt", reason="Windows observer coordination") +def test_independent_registries_serialize_observers_and_release_before_reference( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + import concurrent.futures + import contextlib + import threading + + monkeypatch.setenv("LOCALAPPDATA", str(tmp_path / "local")) + first = coordinator.OutputCoordinator( + tmp_path / "first", registry_validation="indexed" + ) + second = coordinator.OutputCoordinator( + tmp_path / "second", registry_validation="indexed" + ) + assert first._observation_lock().path == second._observation_lock().path + entered, attempted, release = ( + threading.Event(), + threading.Event(), + threading.Event(), + ) + order = [] + actual_lock = second._observation_lock + + @contextlib.contextmanager + def second_lock(): + attempted.set() + with actual_lock(): + yield + + def observe_first(*args, **kwargs): + order.append("first") + entered.set() + assert release.wait(5) + return False + + def observe_second(*args, **kwargs): + order.append("second") + return False + + def reference_first(*args, **kwargs): + # The second observer can enter while the first reference is active. + assert second_entered.wait(5) + + second_entered = threading.Event() + + def reference_second(*args, **kwargs): + second_entered.set() + + monkeypatch.setattr(first, "_preview_committed_index", observe_first) + monkeypatch.setattr(second, "_preview_committed_index", observe_second) + monkeypatch.setattr(second, "_observation_lock", second_lock) + monkeypatch.setattr(first, "_validate_registry_reference", reference_first) + monkeypatch.setattr(second, "_validate_registry_reference", reference_second) + with concurrent.futures.ThreadPoolExecutor(max_workers=2) as pool: + one = pool.submit(first._validate_registry, []) + assert entered.wait(5) + two = pool.submit(second._validate_registry, []) + try: + assert attempted.wait(5) + assert order == ["first"] + finally: + release.set() + one.result(timeout=10) + two.result(timeout=10) + assert order == ["first", "second"] + + +@pytest.mark.parametrize( + "other_flag", + [ + "--experimental-registry-index", + "--experimental-native-observation", + "--experimental-committed-index", + ], ) def test_commit_flag_rejects_other_experiments_before_mutation( tmp_path: Path, capsys, other_flag: str diff --git a/tests/test_output_coordinator.py b/tests/test_output_coordinator.py index bde0214..99ce5f4 100644 --- a/tests/test_output_coordinator.py +++ b/tests/test_output_coordinator.py @@ -25,6 +25,9 @@ def _load_coordinator() -> ModuleType: sys.modules[specification.name] = module specification.loader.exec_module(module) test_mode = os.environ.get("PROTOCYTE_TEST_REGISTRY_VALIDATION", "reference") + if test_mode == "indexed": + # This module is used exclusively by isolated test registries. + module._COMMITTED_INDEX_QUALIFIED = True if test_mode != "reference": original_initialize = module.OutputCoordinator.__init__ @@ -1938,16 +1941,26 @@ def test_registry_comparisons_reject_a_replaced_retained_root( original_overlap = coordinator._paths_overlap changed = False - def overlap(first: Path, second: Path) -> bool: + def replace_retained_root(first: Path, second: Path, result: bool) -> bool: nonlocal changed - result = original_overlap(first, second) if not changed and first == retained_root and second == current[0].root: changed = True # The previously missing directory is replaced after one comparison. _directory_link(retained_root, tmp_path) return result + def overlap(first: Path, second: Path) -> bool: + return replace_retained_root(first, second, original_overlap(first, second)) + monkeypatch.setattr(coordinator, "_paths_overlap", overlap) + if engine.registry_validation == "indexed" and os.name == "nt": + scope_type = coordinator._load_observation_commit().WindowsObservationCommit + native_overlap = scope_type.overlaps + + def indexed_overlap(self: object, first: Path, second: Path) -> bool: + return replace_retained_root(first, second, native_overlap(self, first, second)) + + monkeypatch.setattr(scope_type, "overlaps", indexed_overlap) with pytest.raises(coordinator.CoordinatorError, match="symbolic link or junction"): engine.reconcile_set((), current) assert changed @@ -2125,6 +2138,16 @@ def denied(path: Path, *args: object, **kwargs: object) -> os.stat_result: return original_lstat(path, *args, **kwargs) monkeypatch.setattr(Path, "lstat", denied) + if engine.registry_validation == "indexed" and os.name == "nt": + scope_type = coordinator._load_observation_commit().WindowsObservationCommit + record_exists = scope_type.record_exists + + def inaccessible_record(self: object, path: Path) -> bool: + if path == recorded: + raise PermissionError("metadata denied by test") + return record_exists(self, path) + + monkeypatch.setattr(scope_type, "record_exists", inaccessible_record) with pytest.raises(coordinator.CoordinatorError, match="could not inspect configured output plan"): engine.reconcile(current) claim = engine._state_directory(retained.root) / "claim.json" @@ -2206,6 +2229,27 @@ def samefile_with_root_alias(first_path: object, second_path: object) -> bool: with pytest.raises(coordinator.CoordinatorError, match="overlapping roots"): engine._validate_plan_set((first, second)) + if engine.registry_validation == "indexed" and os.name == "nt": + scope_type = coordinator._load_observation_commit().WindowsObservationCommit + native_identity = scope_type._identity + scope = scope_type(coordinator._load_path_observation(), coordinator._load_ownership_index()) + try: + handle = scope.reader._open_existing(root_a) + assert handle is not None + try: + alias_identity = native_identity(scope, handle) + finally: + scope._release(handle) + finally: + scope.close() + + def identity_with_root_alias(self: object, handle: object) -> tuple[int, int]: + identity = native_identity(self, handle) + canonical = self.reader._describe(handle, leaf_may_be_file=True) + return alias_identity if canonical == root_b else identity + + monkeypatch.setattr(scope_type, "_identity", identity_with_root_alias) + engine.reconcile(first) with pytest.raises(coordinator.CoordinatorError, match="root claimed"): engine.reconcile(second) diff --git a/tests/test_output_coordinator_cmake.py b/tests/test_output_coordinator_cmake.py index b8c0586..91b00ed 100644 --- a/tests/test_output_coordinator_cmake.py +++ b/tests/test_output_coordinator_cmake.py @@ -64,11 +64,17 @@ def test_default_registry_selector_uses_the_isolated_test_cache(tmp_path: Path) @pytest.mark.parametrize( "experimental_flag", - ["--experimental-registry-index", "--experimental-native-observation", "--experimental-observation-commit"], + [ + None, + "--experimental-registry-index", + "--experimental-native-observation", + "--experimental-observation-commit", + "--experimental-committed-index", + ], ) -def test_installed_shadow_coordinator_is_relocatable_and_keeps_prefix_unchanged( +def test_installed_coordinator_is_relocatable_and_keeps_prefix_unchanged( tmp_path: Path, - experimental_flag: str, + experimental_flag: str | None, ) -> None: _, prefix = _test_cmake._configure_fetchcontent_install_fixture( tmp_path, protocyte_install=True @@ -122,15 +128,21 @@ def encoded(path: Path | str) -> str: str(tmp_path / "locks"), "--plan", str(plan), - experimental_flag, + *([experimental_flag] if experimental_flag else []), ], check=False, capture_output=True, text=True, ) - assert result.returncode == 0, result.stdout + result.stderr - assert len(result.stdout.strip()) == 64 - assert len(result.stdout.splitlines()) == 1 + if experimental_flag == "--experimental-committed-index": + assert result.returncode == 1, result.stdout + result.stderr + assert "not qualified for consumer use" in result.stderr + assert not result.stdout + assert not (tmp_path / "locks").exists() + else: + assert result.returncode == 0, result.stdout + result.stderr + assert len(result.stdout.strip()) == 64 + assert len(result.stdout.splitlines()) == 1 assert contents() == before diff --git a/tests/test_ownership_index.py b/tests/test_ownership_index.py index 89d665f..fa168ca 100644 --- a/tests/test_ownership_index.py +++ b/tests/test_ownership_index.py @@ -306,7 +306,7 @@ def test_samples_expire_and_index_only_authorization_is_not_available( operation(tmp_path) with pytest.raises(coordinator.CoordinatorError, match="outside its preview"): sample.same_path(tmp_path, tmp_path) - with pytest.raises(coordinator.CoordinatorError, match="reference or shadow"): + with pytest.raises(coordinator.CoordinatorError, match="registry validation must be"): coordinator.OutputCoordinator( tmp_path / "locks", registry_validation="index-only" ) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 166965c..150cab1 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -4354,10 +4354,17 @@ def test_command_line_plugin_formatter_timeout_stops_hanging_process_tree( ) -> None: grandchild_ready = tmp_path / "formatter-grandchild-ready" child_survived = tmp_path / "formatter-child-survived" - grandchild = ( - "from pathlib import Path; import time; " - f"Path({str(grandchild_ready)!r}).touch(); time.sleep(1); " - f"Path({str(child_survived)!r}).touch()" + child_release = tmp_path / "formatter-child-release" + grandchild = "\n".join( + [ + "from pathlib import Path", + "import time", + f"Path({str(grandchild_ready)!r}).touch()", + "deadline = time.monotonic() + 15", + f"while not Path({str(child_release)!r}).exists() and time.monotonic() < deadline:", + " time.sleep(0.01)", + f"Path({str(child_survived)!r}).touch()", + ] ) child = ( "import subprocess, sys, time; " @@ -4392,21 +4399,27 @@ def test_command_line_plugin_formatter_timeout_stops_hanging_process_tree( ) formatter.chmod(0o755) + # Windows can start several interpreter/redirector processes here. Give + # startup its own margin, then release the descendant only after timeout; + # this tests tree termination rather than a 0.5-second startup assumption. response = generate_response( _basic_request( parameter=( - f"clang_format={formatter.as_posix()},formatter_timeout_seconds=0.5" + f"clang_format={formatter.as_posix()},formatter_timeout_seconds=5" ) ), use_plugin_defaults=True, ) - assert ( - "clang-format timed out for simple.protocyte.hpp after 0.5 seconds" - in response.error - ) - assert not response.file - assert grandchild_ready.is_file() + try: + assert ( + "clang-format timed out for simple.protocyte.hpp after 5.0 seconds" + in response.error + ) + assert not response.file + assert grandchild_ready.is_file() + finally: + child_release.touch() time.sleep(1.25) assert not child_survived.exists() diff --git a/tests/verify_consumer_registry.py b/tests/verify_consumer_registry.py new file mode 100644 index 0000000..bca57ff --- /dev/null +++ b/tests/verify_consumer_registry.py @@ -0,0 +1,424 @@ +"""Non-authorizing qualification against private, real consumer inputs. + +The private manifest supplies registry/current_plans/legacy_coordinator paths. +Capture copies immutable ledger bytes under the original locks; references run +against those frozen bytes and the original output/build/staging paths. Live +candidate/indexed runs always use the original registry and lock namespace. +Indexed exercises the production validation entry point, without proceeding to +reconciliation. No command resets, publishes, or changes defaults. Publish only +the sanitized result receipts; the preservation manifest stays private. +""" + +from __future__ import annotations + +import argparse +import contextlib +import hashlib +import importlib.util +import inspect +import json +import os +import platform +import stat +import sys +import time +from pathlib import Path +from types import ModuleType + +LEGACY_SHA256 = "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85" +IMPLEMENTATION = ( + "ProtocyteOutputCoordinator.py", + "ProtocyteOwnershipIndex.py", + "ProtocytePathObservation.py", + "ProtocyteObservationCommit.py", +) + + +def digest(data: bytes) -> str: + return hashlib.sha256(data).hexdigest() + + +def load(path: Path, name: str) -> ModuleType: + specification = importlib.util.spec_from_file_location(name, path) + assert specification is not None and specification.loader is not None + module = importlib.util.module_from_spec(specification) + sys.modules[name] = module + exec(compile(path.read_bytes(), str(path), "exec"), module.__dict__) + return module + + +def forbid_mutations(module: ModuleType) -> None: + def forbidden(*args, **kwargs): + raise RuntimeError("qualification attempted an ownership/output mutation") + + for name in ( + "_atomic_write", + "_durable_rmtree", + "_durable_unlink", + "_durable_rename", + ): + if hasattr(module, name): + setattr(module, name, forbidden) + for name in ( + "reconcile", + "reconcile_set", + "_reconcile_locked", + "publish", + "reset", + "_recover", + "_apply_pending", + "_publish_one", + "_initialize_claim_locked", + "_release_claim", + "_retire_unplanned", + "_retire_staging", + ): + if hasattr(module.OutputCoordinator, name): + setattr(module.OutputCoordinator, name, forbidden) + + +def ledger(registry: Path) -> dict[str, dict[str, str]]: + def plain(info, expected_type) -> bool: + return ( + expected_type(info.st_mode) + and not stat.S_ISLNK(info.st_mode) + and not getattr(info, "st_file_attributes", 0) & 0x400 + ) + + result = {} + roots = registry / "roots" + assert plain(roots.lstat(), stat.S_ISDIR), "unsafe source registry directory" + for state in sorted(roots.iterdir()): + assert len(state.name) == 64 and all( + c in "0123456789abcdef" for c in state.name + ) + assert plain(state.lstat(), stat.S_ISDIR), "unsafe source registry state" + values = {} + for name in ("claim.json", "plan.json"): + record = state / name + try: + info = record.lstat() + except FileNotFoundError: + continue + assert plain(info, stat.S_ISREG), "unsafe source registry record" + data = record.read_bytes() + values[name] = digest(data) + result[state.name] = values + return result + + +@contextlib.contextmanager +def original_locks(module, engine, plans, *, progress=None): + with contextlib.ExitStack() as stack: + if progress is not None: + progress.phase("waiting for original registry lock", "lock_wait") + stack.enter_context(module.FileLock(engine.lock_root / "registry.lock")) + roots = {module._path_key(plan.root): plan.root for plan in plans} + ordered = sorted(roots.values(), key=module._portable_identity) + if progress is not None: + progress.phase("waiting for original generation locks", "lock_wait") + for root in ordered: + stack.enter_context(module.FileLock(engine._generation_lock(root))) + if progress is not None: + progress.phase("waiting for original publication locks", "lock_wait") + for root in ordered: + stack.enter_context(module.FileLock(engine._publication_lock(root))) + yield + + +def output_fingerprints(module, engine, plans) -> dict: + result = {} + for number, plan in enumerate(plans): + state = engine._state_directory(plan.root) + claim = engine._load_claim(state, plan) + engine._require_current_plan(state, plan, claim) + snapshot = engine._load_snapshot(state, claim) + for relative, entry in snapshot["entries"].items(): + path = plan.root / relative + assert module.project_path(path, leaf_may_be_file=True) == path + assert not module._is_link(path), "consumer output is a link" + data = path.read_bytes() + assert digest(data) == entry["sha256"], ( + "consumer output differs from committed snapshot" + ) + # File names and tokens stay in the private in-memory audit only. + result[str(path)] = (digest(data), path.stat().st_mtime_ns) + assert not list((state / "transactions").iterdir()), ( + "consumer has pending recovery" + ) + result[f"claim-{number}"] = digest((state / "claim.json").read_bytes()) + result[f"snapshot-{number}"] = digest((state / "snapshot.json").read_bytes()) + return result + + +def capture(module, manifest: dict, work: Path) -> dict: + registry = Path(manifest["registry"]) + engine = module.OutputCoordinator(registry) + paths = [Path(path) for path in manifest["current_plans"]] + assert paths and not manifest.get("retired_plans"), ( + "this qualification requires a stable current plan set" + ) + plans = [module.Plan.read(path) for path in paths] + destination = work / "ledger" + destination.mkdir() + with ( + module._ReconcileProgress(len(plans), 0) as progress, + original_locks(module, engine, plans, progress=progress), + ): + progress.phase("capturing read-only consumer ledger", "validation") + forbid_mutations(module) + before = ledger(registry) + assert all("claim.json" in files for files in before.values()) + outputs_before = output_fingerprints(module, engine, plans) + (destination / "roots").mkdir() + for state, files in before.items(): + copied = destination / "roots" / state + copied.mkdir() + for name, expected in files.items(): + data = (registry / "roots" / state / name).read_bytes() + assert digest(data) == expected + (copied / name).write_bytes(data) + inputs = work / "inputs" + inputs.mkdir() + for number, path in enumerate(paths): + (inputs / f"{number:03}.plan").write_bytes(path.read_bytes()) + assert ledger(registry) == before + assert ledger(destination) == before + assert output_fingerprints(module, engine, plans) == outputs_before + (work / "preservation.private.json").write_text( + json.dumps({"ledger": before, "outputs": outputs_before}) + "\n" + ) + receipt = { + "registry_entries": len(before), + "ledger_records": sum(map(len, before.values())), + "current_plans": len(plans), + "targets_per_plan": [len(plan.targets) for plan in plans], + "declared_outputs": sum(len(plan.outputs) for plan in plans), + "committed_output_files_checked": len(outputs_before) - 2 * len(plans), + "claims_plans_snapshots_and_outputs_unchanged": True, + "snapshot_byte_identical": True, + "tokens_produced": 0, + "reconciliation_authorized": False, + } + (work / "capture.json").write_text(json.dumps(receipt, indent=2) + "\n") + return receipt + + +def reference(module, manifest: dict, work: Path) -> dict: + # The namespace-only pass executes the actual reference checks with its + # original registry location. Only its root listing is empty; the separate + # full pass below validates every copied foreign record without filtering. + original = module.OutputCoordinator(Path(manifest["registry"])) + plans = [ + module.Plan.read(path) for path in sorted((work / "inputs").glob("*.plan")) + ] + call_name = ( + "_validate_registry_reference" + if hasattr(original, "_validate_registry_reference") + else "_validate_registry" + ) + forbid_mutations(module) + real_scandir = module.os.scandir + + class EmptyListing: + def __enter__(self): + return iter(()) + + def __exit__(self, *args): + pass + + def namespace_listing(path): + if Path(path) == original.lock_root / "roots": + return EmptyListing() + return real_scandir(path) + + module.os.scandir = namespace_listing + try: + getattr(original, call_name)(plans, set()) + finally: + module.os.scandir = real_scandir + engine = module.OutputCoordinator(work / "ledger") + before = ledger(engine.lock_root) + start, cpu = time.perf_counter(), time.process_time() + with module._ReconcileProgress(len(plans), 0) as progress: + progress.phase("read-only frozen consumer reference", "validation") + module.OutputCoordinator._validate_plan_set(plans) + function = getattr(engine, call_name) + kwargs = ( + {"progress": progress} + if "progress" in inspect.signature(function).parameters + else {} + ) + function(plans, set(), **kwargs) + checked = progress._claims + seconds = time.perf_counter() - start + cpu_seconds = time.process_time() - cpu + assert ledger(engine.lock_root) == before + return { + "result": "accepted", + "registry_entries": len(before), + "claims_checked": checked, + "validation_seconds": seconds, + "validation_cpu_seconds": cpu_seconds, + "frozen_ledger": True, + "original_output_paths": True, + "original_namespace_checked_separately": True, + "live_shared_lock_held": False, + "ownership_or_output_mutations": 0, + } + + +def candidate(module, manifest: dict, work: Path, *, integrated: bool = False) -> dict: + engine = module.OutputCoordinator( + Path(manifest["registry"]), + registry_validation="indexed" if integrated else "reference", + ) + if integrated: + # A failed timing gate must not hold the live shared lock for a slow + # reference pass. The full reference oracles are qualified separately; + # successful production entry-point execution must never call this. + def unexpected_reference(*args, **kwargs): + raise RuntimeError("live indexed qualification required reference fallback") + + engine._validate_registry_reference = unexpected_reference + start = time.perf_counter() + plans = [module.Plan.read(Path(path)) for path in manifest["current_plans"]] + parse_seconds = time.perf_counter() - start + start = time.perf_counter() + with ( + module._ReconcileProgress(len(plans), 0) as progress, + original_locks(module, engine, plans, progress=progress), + ): + lock_seconds = time.perf_counter() - start + forbid_mutations(module) + progress.phase("read-only live consumer candidate", "validation") + start, cpu = time.perf_counter(), time.process_time() + engine.validation_metrics = { + "mode": "consumer-candidate-only", + "authoritative": "none", + } + module.OutputCoordinator._validate_plan_set(plans) + if integrated: + qualified = module._COMMITTED_INDEX_QUALIFIED + try: + # The ownership/output mutation guard above is already active. + # Override only this import, never a consumer process or file. + module._COMMITTED_INDEX_QUALIFIED = True + engine._validate_registry(plans, set(), progress=progress) + finally: + module._COMMITTED_INDEX_QUALIFIED = qualified + accepted = True + else: + accepted = engine._preview_committed_index(plans, set(), progress=progress) + seconds = time.perf_counter() - start + parse_seconds + cpu_seconds = time.process_time() - cpu + metrics = engine.validation_metrics + assert metrics["commit_certificate"] == "verified" + assert metrics["commit_state"] == "closed" + assert metrics["commit_handles_opened"] == metrics["commit_handles_closed"] + if integrated: + assert metrics["authoritative"] == "index" + assert metrics["reference_wall_seconds"] == 0 + return { + "result": "accepted" if accepted else "conflict", + "validation_seconds": seconds, + "validation_cpu_seconds": cpu_seconds, + "plan_parse_seconds": parse_seconds, + "lock_wait_seconds": lock_seconds, + "current_plans": len(plans), + "registry_entries": metrics["commit_claims_checked"], + "original_live_registry_and_locks": True, + "native_metrics": metrics, + "ownership_or_output_mutations": 0, + "tokens_produced": 0, + } + + +def audit(module, manifest: dict, work: Path) -> dict: + engine = module.OutputCoordinator( + Path(manifest["registry"]), registry_validation="reference" + ) + plans = [module.Plan.read(Path(path)) for path in manifest["current_plans"]] + expected = json.loads((work / "preservation.private.json").read_bytes()) + with original_locks(module, engine, plans): + forbid_mutations(module) + assert ledger(engine.lock_root) == expected["ledger"] + outputs = output_fingerprints(module, engine, plans) + assert json.loads(json.dumps(outputs)) == expected["outputs"] + return { + "registry_entries": len(expected["ledger"]), + "committed_output_files_checked": len(outputs) - 2 * len(plans), + "claims_plans_snapshots_outputs_and_mtimes_unchanged": True, + "ownership_or_output_mutations": 0, + "tokens_produced": 0, + } + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--manifest", type=Path, required=True) + parser.add_argument("--work", type=Path, required=True) + parser.add_argument( + "--mode", + choices=( + "capture", + "candidate", + "indexed", + "audit", + "reference", + "legacy-reference", + ), + required=True, + ) + args = parser.parse_args() + driver_fingerprint = digest(Path(__file__).read_bytes()) + args.work = args.work.absolute() + sys.dont_write_bytecode = True + os.environ.pop("PROTOCYTE_COORDINATOR_CRASH_AFTER", None) + manifest = json.loads(args.manifest.read_bytes()) + if args.mode == "capture": + args.work.mkdir(parents=True, exist_ok=False) + else: + assert args.work.is_dir() + source = Path(__file__).resolve().parents[1] / "cmake/ProtocyteOutputCoordinator.py" + if args.mode == "legacy-reference": + source = Path(manifest["legacy_coordinator"]) + assert digest(source.read_bytes()) == LEGACY_SHA256 + fingerprints = {source.name: digest(source.read_bytes())} + if args.mode != "legacy-reference": + fingerprints = { + name: digest(source.with_name(name).read_bytes()) for name in IMPLEMENTATION + } + module = load(source, "qualified_consumer_" + args.mode.replace("-", "_")) + if args.mode == "capture": + result = capture(module, manifest, args.work) + elif args.mode in ("candidate", "indexed"): + result = candidate( + module, manifest, args.work, integrated=args.mode == "indexed" + ) + elif args.mode == "audit": + result = audit(module, manifest, args.work) + else: + result = reference(module, manifest, args.work) + assert all( + digest(source.with_name(name).read_bytes()) == expected + for name, expected in fingerprints.items() + ) + assert digest(Path(__file__).read_bytes()) == driver_fingerprint + report = { + "mode": args.mode, + "platform": platform.system(), + "python": platform.python_version(), + "implementation_files": fingerprints, + "qualification_driver_sha256": driver_fingerprint, + "index_authorization_enabled": False, + **result, + } + (args.work / f"{args.mode}-{time.time_ns()}-results.json").write_text( + json.dumps(report, indent=2) + "\n" + ) + print(json.dumps(report), flush=True) + + +if __name__ == "__main__": + main() diff --git a/tests/verify_coordinator_upgrade.py b/tests/verify_coordinator_upgrade.py index bf42fd0..8450451 100644 --- a/tests/verify_coordinator_upgrade.py +++ b/tests/verify_coordinator_upgrade.py @@ -76,6 +76,9 @@ def load(name: str, script: Path): old = load("review_legacy", LEGACY) new = load("review_current", CURRENT) + assert new._COMMITTED_INDEX_QUALIFIED is False + # Only isolated fixture registries below can exercise provisional authority. + new._COMMITTED_INDEX_QUALIFIED = True assert old.PROTOCOL_VERSION == new.PROTOCOL_VERSION == 1 assert old.PLAN_HEADER == new.PLAN_HEADER @@ -127,10 +130,21 @@ def functions(source: bytes): ) assert ast.dump(checkpoint["FileLock"]) == ast.dump(candidate["FileLock"]) + indexed_validations = [] + def engine(version: str, locks: Path): if version == "old": return old.OutputCoordinator(locks) - return new.OutputCoordinator(locks, registry_validation=version) + result = new.OutputCoordinator(locks, registry_validation=version) + if version == "indexed": + validate = result._validate_registry + + def recorded(*args, **kwargs): + validate(*args, **kwargs) + indexed_validations.append(dict(result.validation_metrics)) + + result._validate_registry = recorded + return result def module(version: str): return old if version == "old" else new @@ -197,6 +211,17 @@ def run(version: str, command: str, locks: Path, plan: Path, extras=(), crash=No args.append("--experimental-native-observation") elif version == "commit-shadow": args.append("--experimental-observation-commit") + elif version == "indexed": + args.append("--experimental-committed-index") + qualified_main = ( + "import importlib.util,sys; " + "spec=importlib.util.spec_from_file_location('qualified_upgrade_cli',sys.argv[1]); " + "module=importlib.util.module_from_spec(spec); " + "sys.modules[spec.name]=module; spec.loader.exec_module(module); " + "module._COMMITTED_INDEX_QUALIFIED=True; " + "raise SystemExit(module.main(sys.argv[2:]))" + ) + args = [sys.executable, "-c", qualified_main, *args[1:]] environment = os.environ.copy() environment.pop("PROTOCYTE_COORDINATOR_CRASH_AFTER", None) if crash: @@ -223,6 +248,8 @@ def run(version: str, command: str, locks: Path, plan: Path, extras=(), crash=No ("native-shadow", "old"), ("old", "commit-shadow"), ("commit-shadow", "old"), + ("old", "indexed"), + ("indexed", "old"), ) for writer, reader in transitions: root, locks, plan, target, staging = fixture(f"steady-{writer}-{reader}") @@ -271,6 +298,8 @@ def run(version: str, command: str, locks: Path, plan: Path, extras=(), crash=No ("native-shadow", "old"), ("old", "commit-shadow"), ("commit-shadow", "old"), + ("old", "indexed"), + ("indexed", "old"), ): for phase in ( "after-pending", @@ -379,6 +408,15 @@ def run(version: str, command: str, locks: Path, plan: Path, extras=(), crash=No "reference_validator_ast_unchanged_since_checkpoint": reference_unchanged, "file_lock_ast_unchanged_since_checkpoint": True, "passed_cases": len(results), + "production_index_authorization_qualified": False, + "index_authority_enabled_only_in_isolated_fixture_module": True, + "indexed_validations": len(indexed_validations), + "index_authorized_validations": sum( + metrics["authoritative"] == "index" for metrics in indexed_validations + ), + "indexed_reference_fallbacks": sum( + metrics.get("fallback") == "reference" for metrics in indexed_validations + ), "cases": results, } (WORK / "upgrade-results.json").write_text(json.dumps(report, indent=2) + "\n") From c3a902ad1897cb01d55fd58d952be9970ccd359d Mon Sep 17 00:00:00 2001 From: Anthony Printup <92564080+anthonyprintup@users.noreply.github.com> Date: Mon, 16 Nov 2026 20:43:31 +0100 Subject: [PATCH 08/12] perf(coordinator): enable qualified parallel registry validation Freeze prepared endpoint views before dispatching bounded batches to four workers. Preserve every fresh negative probe, synchronize accounting, and drain native work behind an admission fence before sealing or root release. Abort before mutation when worker retirement cannot be proved. Reject impersonating, emulated, and uncertain worker contexts to reference validation. Enable automatic committed-index validation on capable Windows invocations after 20 complete retained-workload runs stayed under 30 seconds, including ten under concurrent full reference-reader load. Keep reference fallback and add environment/CLI reference overrides without changing protocol-v1 records, tokens, ownership locks, publication, or crash recovery. Qualify interruption, late submission, shutdown, reverse-probe races, mixed helpers, and 1024 serial/parallel differential cases. Preserve deliberate test concurrency while isolating unrelated journal-marker tests. Record anonymous per-run metrics, unchanged-output audits, independent full oracles, source fingerprints, and final packaging/minimum-Python/upgrade evidence. Validation: 1927 default tests; 89 explicit indexed tests; 201 Python 3.12 native/index tests; 22 CMake integration tests; 111 cross-version upgrade, rollback, and crash-recovery cases; Ruff. Formal validation ranges were 14.489-16.538 seconds at the enabled default and 23.003-27.461 under load. Refs #54. --- cmake/ProtocyteObservationCommit.py | 359 ++- cmake/ProtocyteOutputCoordinator.py | 67 +- docs/consumer-validation-results.md | 5 + docs/experimental-index-contract.md | 5 + docs/observation-commit-contract.md | 88 +- docs/observation-commit-results.md | 4 +- docs/parallel-probe-results.json | 2712 +++++++++++++++++ docs/parallel-probe-results.md | 203 ++ docs/wiki/Contributing.md | 9 +- docs/wiki/Troubleshooting.md | 9 + tests/conftest.py | 43 + tests/test_consumer_registry_qualification.py | 13 +- tests/test_observation_commit.py | 18 +- tests/test_output_coordinator.py | 21 +- tests/test_output_coordinator_cmake.py | 7 +- tests/test_parallel_probes.py | 612 ++++ tests/verify_consumer_registry.py | 36 +- tests/verify_coordinator_upgrade.py | 24 +- 18 files changed, 4157 insertions(+), 78 deletions(-) create mode 100644 docs/parallel-probe-results.json create mode 100644 docs/parallel-probe-results.md create mode 100644 tests/test_parallel_probes.py diff --git a/cmake/ProtocyteObservationCommit.py b/cmake/ProtocyteObservationCommit.py index eb6f14f..56dcf3f 100644 --- a/cmake/ProtocyteObservationCommit.py +++ b/cmake/ProtocyteObservationCommit.py @@ -11,11 +11,15 @@ import ctypes import contextlib +import concurrent.futures import json import os import struct +import threading +from collections import deque from dataclasses import dataclass from pathlib import Path +from types import MappingProxyType from typing import Any, Iterable, Mapping @@ -31,6 +35,172 @@ class ObservationChanged(RuntimeError): pass +class ProbeCleanupFailed(RuntimeError): + """Worker retirement failed: reference fallback must not authorize mutation.""" + + +class ProbeSession: + """Bounded independent comparisons; no query can outlive close, even on error. + + The admission gate also covers a task queued by a submit call that raises + before returning its Future. Shutdown closes admission first, then joins + the executor and independently drains all admitted native work. + """ + + BATCH_SIZE = 32 + + def __init__(self, compare, *, workers: int = 4) -> None: + if type(workers) is not int or not 1 <= workers <= 4: + raise CapabilityUnavailable("unsupported probe worker bound") + self.workers = workers + self._owner = threading.get_ident() + self._compare = compare + self._condition = threading.Condition() + self._accepting = True + self._native_retired = False + self._finished = False + self._close_error: BaseException | None = None + self._active = self._peak = 0 + self._started = self._completed = self._comparisons = 0 + self._submitted = self._peak_pending = 0 + self._threads: set[int] = set() + self._futures: set[Any] = set() + self._executor = concurrent.futures.ThreadPoolExecutor( + max_workers=workers, thread_name_prefix="protocyte-probes" + ) + + def _run(self, batch): + with self._condition: + if not self._accepting: + raise ObservationChanged("probe work admitted after retirement") + self._active += 1 + self._peak = max(self._peak, self._active) + self._started += 1 + self._threads.add(threading.get_ident()) + completed = 0 + result = [] + try: + for reservation, prepared in batch: + if self._compare(prepared): + result.append(reservation) + completed += 1 + return result + finally: + with self._condition: + self._comparisons += completed + self._completed += 1 + self._active -= 1 + self._condition.notify_all() + + def compare(self, prepared): + self._require_owner() + with self._condition: + if not self._accepting: + raise ObservationChanged("probe session used after retirement") + rows = iter(prepared) + pending = deque() + result = [] + + def submit() -> bool: + batch = [] + for _ in range(self.BATCH_SIZE): + try: + batch.append(next(rows)) + except StopIteration: + break + if not batch: + return False + future = self._executor.submit(self._run, tuple(batch)) + self._futures.add(future) + pending.append(future) + self._submitted += 1 + self._peak_pending = max(self._peak_pending, len(pending)) + return True + + try: + for _ in range(self.workers * 2): + if not submit(): + break + while pending: + future = pending.popleft() + result.extend(future.result()) + self._futures.remove(future) + submit() + return result + except BaseException: + # This finishes every admitted query before the exception can + # reach the read set's handle-release/fallback boundary. + self.close() + raise + + def close(self) -> None: + self._require_owner() + if not self._finished: + # Close admission and drain *before* touching the executor. Catch + # interruption at lock acquisition as well as inside wait(). This + # monotonic fence is independently checked before root release. + while True: + try: + with self._condition: + self._accepting = False + if not self._active: + self._native_retired = True + break + self._condition.wait() + except BaseException as error: + if self._close_error is None: + self._close_error = error + for future in self._futures: + try: + future.cancel() + except BaseException as error: + if self._close_error is None: + self._close_error = error + try: + self._executor.shutdown(wait=True, cancel_futures=True) + except BaseException as error: + if self._close_error is None: + self._close_error = error + self._futures.clear() + self._compare = None + self._finished = True + if self._close_error is not None: + if isinstance(self._close_error, Exception): + raise ProbeCleanupFailed( + "probe worker retirement failed" + ) from self._close_error + raise self._close_error + + def _require_owner(self) -> None: + if threading.get_ident() != self._owner: + raise ObservationChanged("probe session control used by a worker") + + @property + def native_retired(self) -> bool: + return self._native_retired + + def metrics(self) -> dict[str, Any]: + with self._condition: + return { + "commit_probe_state": "failed" + if self._close_error is not None + else "closed" + if self._finished + else "active", + "commit_probe_workers": self.workers, + "commit_probe_native_retired": self._native_retired, + "commit_probe_threads": len(self._threads), + "commit_probe_active": self._active, + "commit_probe_peak_active": self._peak, + "commit_probe_pending": len(self._futures), + "commit_probe_peak_pending": self._peak_pending, + "commit_probe_batches_submitted": self._submitted, + "commit_probe_batches_started": self._started, + "commit_probe_batches_finished": self._completed, + "commit_probe_comparisons": self._comparisons, + } + + CLOSE_REASON = 0x80000000 @@ -131,6 +301,56 @@ class _Volume: first: int +class _FrozenComparisons: + """Workers see prepared immutable views, never the mutable observation maps.""" + + def __init__(self, scope, workers: int) -> None: + self._scope = scope + self._views = MappingProxyType(dict(scope._views)) + self._closed = False + self.probe_session = ProbeSession(self._compare, workers=workers) + + def _get(self, path: Path) -> _View: + if self._closed: + raise ObservationChanged("frozen comparisons used after retirement") + self._scope._require_owner() + if self._scope._state != "comparing": + raise ObservationChanged("comparisons used outside their phase") + view = self._views.get(str(path)) + if view is None: + raise CommitUnavailable("comparison path was not observed before freezing") + if not view.missing and not view.guard.is_directory: + raise ObservationChanged("non-directory comparison endpoint") + return view + + def is_stable(self, path: Path) -> bool: + return not self._get(path).missing + + def facts(self, path: Path): + return self._get(path).facts + + def prepare_overlap(self, first: Path, second: Path): + return self._get(first), self._get(second) + + def _compare(self, prepared) -> bool: + if self._closed or self._scope._state != "comparing": + raise ObservationChanged("prepared comparison used after retirement") + return self._scope._overlaps_views(*prepared) + + def close(self) -> None: + try: + self.probe_session.close() + finally: + if not self.probe_session.native_retired: + # Preserve views and root bindings if an interruption happens + # before close() can enter its draining loop. Scope cleanup can + # retry, but must never release handles on an unproved fence. + raise ProbeCleanupFailed("native probe retirement is unproved") + self._closed = True + self._views = MappingProxyType({}) + self._scope = None + + class WindowsObservationCommit: """One bounded read set; instances and facts are never shared across phases.""" @@ -145,6 +365,9 @@ def __init__(self, native: Any, model: Any) -> None: self.reader = native.FreshPathObserver() self.w = self.reader._w self._state = "active" + self._owner = threading.get_ident() + self._negative_lock = threading.Lock() + self._comparison_reader: _FrozenComparisons | None = None self._objects: dict[tuple[int, int], _Guard] = {} self._volumes: dict[int, _Volume] = {} self._roots: dict[str, _View] = {} @@ -171,6 +394,7 @@ def __init__(self, native: Any, model: Any) -> None: "commit_record_seek_calls", "commit_directory_enumerations", "commit_full_inventory_scans", + "commit_worker_context_checks", ) } @@ -228,11 +452,92 @@ class Basic(ctypes.Structure): self.w.DWORD, ) self._fs_info.restype = self.w.BOOL + self._check_worker_context() + + def _check_worker_context(self) -> None: + self._counts["commit_worker_context_checks"] += 1 + if ctypes.sizeof(ctypes.c_void_p) != 8: + raise CapabilityUnavailable( + "parallel probes require a native 64-bit process" + ) + kernel = self.reader._kernel + current_process = kernel.GetCurrentProcess + current_process.argtypes = () + current_process.restype = self.w.HANDLE + machine = getattr(kernel, "IsWow64Process2", None) + if machine is None: + raise CapabilityUnavailable("native process context cannot be established") + machine.argtypes = ( + self.w.HANDLE, + ctypes.POINTER(self.w.WORD), + ctypes.POINTER(self.w.WORD), + ) + machine.restype = self.w.BOOL + process_machine, native_machine = self.w.WORD(), self.w.WORD() + if ( + not machine( + current_process(), + ctypes.byref(process_machine), + ctypes.byref(native_machine), + ) + or process_machine.value + or native_machine.value not in (0x8664, 0xAA64) + ): + raise CapabilityUnavailable( + "emulated filesystem context needs reference validation" + ) + current_thread = kernel.GetCurrentThread + current_thread.argtypes = () + current_thread.restype = self.w.HANDLE + open_token = ctypes.WinDLL("advapi32", use_last_error=True).OpenThreadToken + open_token.argtypes = ( + self.w.HANDLE, + self.w.DWORD, + self.w.BOOL, + ctypes.POINTER(self.w.HANDLE), + ) + open_token.restype = self.w.BOOL + token = self.w.HANDLE() + if open_token(current_thread(), 0x8, True, ctypes.byref(token)): + if not self.reader._close(token): + raise ProbeCleanupFailed("thread token handle could not be retired") + raise CapabilityUnavailable( + "impersonating caller needs reference validation" + ) + if ctypes.get_last_error() != 1008: # ERROR_NO_TOKEN is the required result. + raise CapabilityUnavailable("ordinary thread context cannot be established") def _active(self) -> None: + self._require_owner() if self._state != "active": raise ObservationChanged("read set used outside its observation phase") + def _require_owner(self) -> None: + if threading.get_ident() != self._owner: + raise ObservationChanged("mutable observations used by a worker") + + @contextlib.contextmanager + def comparisons(self, *, workers: int = 4): + self._active() + if self._comparison_reader is not None: + raise ObservationChanged("read set comparisons already retired") + self._check_worker_context() + self._state = "comparing" + try: + reader = _FrozenComparisons(self, workers) + except BaseException: + self._state = "active" + raise + self._comparison_reader = reader + try: + yield reader + finally: + try: + reader.close() + finally: + if reader.probe_session.native_retired: + self._state = "observed" + def _io( self, handle: Any, code: int, request: bytes | None, capacity: int ) -> bytes: @@ -442,7 +747,10 @@ def _open_child(self, request: Any): return handle def _probe_absence(self, request: Any) -> None: - self._counts["commit_negative_probes"] += 1 + if self._state not in ("active", "comparing", "sealing"): + raise ObservationChanged("negative probe used after its phase") + with self._negative_lock: + self._counts["commit_negative_probes"] += 1 value = self._basic_type() code = self._query(ctypes.byref(request[2]), ctypes.byref(value)) & 0xFFFFFFFF if code not in (0xC0000034, 0xC000003A): @@ -595,6 +903,11 @@ def same_path(self, first: Path, second: Path) -> bool: def overlaps(self, first: Path, second: Path) -> bool: left, right = self._descriptor(first), self._descriptor(second) + return self._overlaps_views(left, right) + + def _overlaps_views(self, left: _View, right: _View) -> bool: + if self._state not in ("active", "comparing"): + raise ObservationChanged("comparison used after its phase") def refresh(view: _View) -> None: if view.missing: @@ -778,7 +1091,17 @@ def _collect_witnesses(self, volume: _Volume, expected: dict[int, int]) -> None: self._counts["commit_witnesses"] += len(expected) def seal(self) -> None: - self._active() + self._require_owner() + if self._state not in ("active", "observed"): + raise ObservationChanged("read set sealed outside its phase") + if self._comparison_reader is not None: + probes = self._comparison_reader.probe_session.metrics() + if ( + probes["commit_probe_state"] != "closed" + or probes["commit_probe_active"] + or probes["commit_probe_pending"] + ): + raise ProbeCleanupFailed("probe workers were not retired before seal") self._state = "sealing" for guard, names, relevant in self._inventories: current = self._list_handle(guard) @@ -839,15 +1162,26 @@ def certify(guard: _Guard, handle: Any) -> None: self._state = "sealed" def close(self) -> None: - self._state = "closed" + self._require_owner() error = None + if self._comparison_reader is not None: + try: + self._comparison_reader.close() + except BaseException as failure: + error = failure + if not self._comparison_reader.probe_session.native_retired: + raise ProbeCleanupFailed( + "root handles cannot close before native probe retirement" + ) from error + self._state = "closed" for guard in reversed(tuple(self._objects.values())): if guard.handle is None: continue try: self._release(guard.handle) - except Exception as failure: - error = failure + except BaseException as failure: + if error is None: + error = failure self._objects.clear() self._views.clear() self._roots.clear() @@ -859,8 +1193,14 @@ def close(self) -> None: raise error def metrics(self) -> dict[str, Any]: + probes = ( + {} + if self._comparison_reader is None + else self._comparison_reader.probe_session.metrics() + ) return { **self._counts, + **probes, "commit_info_calls": self._counts["commit_info_calls"] + self.reader.information_calls, "commit_state": self._state, @@ -900,6 +1240,15 @@ def _overlapping(self, path: Path): remaining = tuple( (reservation, reserved) for reservation, reserved, _ in self.entries ) + probes = getattr(self.filesystem, "probe_session", None) + if probes is not None: + prepared = tuple( + (reservation, self.filesystem.prepare_overlap(reserved, path)) + for reservation, reserved in remaining + ) + self.fresh_comparisons += len(prepared) + yield from probes.compare(prepared) + return for reservation, reserved in remaining: self.fresh_comparisons += 1 if self.filesystem.overlaps(reserved, path): diff --git a/cmake/ProtocyteOutputCoordinator.py b/cmake/ProtocyteOutputCoordinator.py index baebb6c..8f04d0c 100644 --- a/cmake/ProtocyteOutputCoordinator.py +++ b/cmake/ProtocyteOutputCoordinator.py @@ -36,10 +36,10 @@ PROTOCOL_VERSION = 1 -# The retained consumer timing gate failed. Only isolated/mutation-forbidden -# qualification drivers override this in their own imported module instance. -# Neither a CLI option nor consumer configuration can promote the index. -_COMMITTED_INDEX_QUALIFIED = False +# Qualified on the complete retained consumer workload, including concurrent +# reference-reader load. Runtime capability, complete worker retirement, and +# exact native witnesses remain mandatory; every unverified case uses reference. +_COMMITTED_INDEX_QUALIFIED = True PLAN_HEADER = "protocyte-output-plan-v1" GENERATED_SUFFIXES = (".protocyte.cpp", ".protocyte.hpp", "/runtime.hpp") @@ -1084,7 +1084,15 @@ def _load_observation_commit() -> Any: class OutputCoordinator: - def __init__(self, lock_root: Path, *, registry_validation: str = "reference") -> None: + def __init__(self, lock_root: Path, *, registry_validation: str | None = None) -> None: + if registry_validation is None: + selected = os.environ.get("PROTOCYTE_REGISTRY_VALIDATION", "auto").strip().lower() or "auto" + if selected not in ("auto", "reference"): + _fail("PROTOCYTE_REGISTRY_VALIDATION must be auto or reference") + registry_validation = ( + "indexed" if selected == "auto" and _COMMITTED_INDEX_QUALIFIED and os.name == "nt" + else "reference" + ) if registry_validation not in ("reference", "shadow", "native-shadow", "commit-shadow", "indexed"): _fail("registry validation must be reference, indexed, or shadow (including native/commit-shadow)") self.lock_root = project_path(_require_absolute(lock_root, "output lock root")) @@ -1528,6 +1536,10 @@ def _validate_registry( ) metrics["preview_result"] = "accepted" if preview_accepted else "conflict" except Exception as error: + module = _observation_commit_module + cleanup_failure = getattr(module, "ProbeCleanupFailed", None) + if cleanup_failure is not None and isinstance(error, cleanup_failure): + _fail("native probe workers could not be retired safely; no reconciliation changes were authorized") # A failed or unsupported certificate grants no authority. The # ordinary reference path still determines this operation. metrics["preview_result"] = "unverified" @@ -1541,6 +1553,15 @@ def _validate_registry( preview_accepted is True and metrics.get("commit_certificate") == "verified" and metrics.get("commit_state") == "closed" + and metrics.get("commit_probe_state") == "closed" + and metrics.get("commit_probe_native_retired") is True + and type(metrics.get("commit_probe_active")) is int + and metrics["commit_probe_active"] == 0 + and type(metrics.get("commit_probe_pending")) is int + and metrics["commit_probe_pending"] == 0 + and type(metrics.get("commit_probe_comparisons")) is int + and type(metrics.get("commit_fresh_comparisons")) is int + and metrics["commit_probe_comparisons"] == metrics["commit_fresh_comparisons"] and type(metrics.get("commit_handles_opened")) is int and type(metrics.get("commit_handles_closed")) is int and metrics["commit_handles_opened"] > 0 @@ -1700,15 +1721,22 @@ def _preview_committed_index( if progress is not None: progress.registry(claim=True) progress.phase(f"provisional observation commit ({metrics['commit_claims_checked']} claims)", "validation") - index = module.ProvisionalOwnershipIndex(model, scope, entries) - for plan in plans: - conflict = index.conflict( - root=plan.root, root_key=scope.path_key(plan.root), build_id=plan.build_id, - staging=((target.identity, target.staging) for target in plan.targets), - retiring_root_keys=retiring_root_keys, - ) - if conflict is not None: - accepted = False + queries = [ + (plan.root, scope.path_key(plan.root), plan.build_id, + tuple((target.identity, target.staging) for target in plan.targets)) + for plan in plans + ] + # Registration is complete before any worker can run. The frozen + # adapter exposes prepared immutable comparisons, not path lookup. + with scope.comparisons() as comparisons: + index = module.ProvisionalOwnershipIndex(model, comparisons, entries) + for root, key, build, staging in queries: + conflict = index.conflict( + root=root, root_key=key, build_id=build, + staging=staging, retiring_root_keys=retiring_root_keys, + ) + if conflict is not None: + accepted = False metrics["commit_reservations"] = len(entries) metrics["commit_index_queries"] = index.queries metrics["commit_fresh_comparisons"] = index.fresh_comparisons @@ -2657,6 +2685,10 @@ def _parse_arguments(arguments: Sequence[str]) -> argparse.Namespace: parser.add_argument( "--experimental-committed-index", action="store_true", help=argparse.SUPPRESS ) + parser.add_argument( + "--reference-registry-validation", action="store_true", + help="use the full reference registry validator", + ) return parser.parse_args(arguments) @@ -2671,17 +2703,18 @@ def main(arguments: Sequence[str] | None = None) -> int: return 0 if options.lock_root is None: _fail(f"{options.command} requires --lock-root") - if sum((options.experimental_native_observation, options.experimental_registry_index, options.experimental_observation_commit, options.experimental_committed_index)) > 1: + if sum((options.experimental_native_observation, options.experimental_registry_index, options.experimental_observation_commit, options.experimental_committed_index, options.reference_registry_validation)) > 1: _fail("choose one experimental validation mode") if options.experimental_committed_index and not _COMMITTED_INDEX_QUALIFIED: _fail("committed index is not qualified for consumer use; reference validation is required") coordinator = OutputCoordinator( options.lock_root, registry_validation=( - "indexed" if options.experimental_committed_index + "reference" if options.reference_registry_validation + else "indexed" if options.experimental_committed_index else "commit-shadow" if options.experimental_observation_commit else "native-shadow" if options.experimental_native_observation - else "shadow" if options.experimental_registry_index else "reference" + else "shadow" if options.experimental_registry_index else None ), ) if options.command == "reconcile-set": diff --git a/docs/consumer-validation-results.md b/docs/consumer-validation-results.md index c56c3bc..b8418f2 100644 --- a/docs/consumer-validation-results.md +++ b/docs/consumer-validation-results.md @@ -1,5 +1,10 @@ # Retained consumer qualification +Historical serial qualification at `8851bde`. Its failed timing gate and source +fingerprints are preserved here. The subsequent +[parallel-probe qualification](parallel-probe-results.md) passed the gate and +documents the current automatic default on the experimental branch. + This report uses an anonymous retained consumer configuration, not a synthetic replacement. Raw manifests, logs, claim tokens, ledger copies, paths, and output names stay in ignored local evidence. **Promotion failed:** six of ten complete diff --git a/docs/experimental-index-contract.md b/docs/experimental-index-contract.md index 5439b1b..bb43025 100644 --- a/docs/experimental-index-contract.md +++ b/docs/experimental-index-contract.md @@ -1,5 +1,10 @@ # Experimental ownership-index contract +This records the first sampled-index experiment. For the current qualified +parallel observation mechanism and automatic Windows default, see the +[observation contract](observation-commit-contract.md) and +[parallel results](parallel-probe-results.md). + Branch: `codex/experimental-generation-engine`, based on preservation checkpoint `f804fd1` (`codex/issue-54-registry-scaling`). No remote publication is involved. diff --git a/docs/observation-commit-contract.md b/docs/observation-commit-contract.md index daa5a74..e5b7253 100644 --- a/docs/observation-commit-contract.md +++ b/docs/observation-commit-contract.md @@ -1,13 +1,13 @@ # Experimental observation commit -Status: experimental `commit-shadow` and `indexed` integrations on -`codex/experimental-generation-engine`. The -[retained consumer qualification](consumer-validation-results.md) failed the -reliable-under-30-second timing gate. The default remains reference validation. -An explicit source guard blocks consumer index authority, including the private -API and CLI. Isolated fixtures and the mutation-forbidden read-only harness can -exercise the proposed indexed success path; it accepts only a verified, fully -closed read set. Other outcomes use reference validation. +Status: qualified parallel `indexed` validation is the automatic Windows default +on `codex/experimental-generation-engine`. The +[parallel-probe qualification](parallel-probe-results.md) passed 20/20 complete +retained-workload validations below 30 seconds, including ten under concurrent +reference-reader load. Index authority still requires a verified certificate, +complete worker retirement, and balanced native handle accounting. Unsupported +or unverified observations use reference validation; failed worker retirement +aborts before mutation. `commit-shadow` remains available for differential checks. This replaces the previous fresh-observation experiment's repeated full path walks with a provisional read set. Its certificate verifies the requested native @@ -27,13 +27,22 @@ schema, root key, build identity, plan digest, and projected paths. The index is an in-memory derivative, never a replacement for authenticating those records. The prototype accepts local DOS-drive paths on NTFS with an already active USN -journal and the required ordinary-user handle operations. It does not create or +journal and the required ordinary-user handle operations, in a native 64-bit +AMD64 or ARM64 process without a caller thread impersonation token. It does not create or configure a journal. Unsupported paths, filesystems, access, case-sensitive directories at initial observation, record formats, API responses, resource budgets, or changed observations abandon the candidate and run the reference validator. A missing capability never requests administrator access or a user configuration change. +The caller context is checked before observation and again before starting +workers. A 32-bit or emulated process, an impersonating thread, an unavailable +context API, or any result other than `ERROR_NO_TOKEN` from `OpenThreadToken` +uses reference validation. New threads use the process context; silently moving +an impersonating caller's lookups to that context would change their meaning. +See [thread creation](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createthread) +and [thread token inspection](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-openthreadtoken). + Windows object identity consists of the volume serial and the full 128-bit file ID. Reaching a second drive with an already observed volume serial forces reference fallback, preventing ambiguous root-handle routing. Every positive @@ -154,6 +163,35 @@ handles have been released, and the read set has been erased before the caller can enter the unchanged reconciliation and mutation methods. There is no new claim that namespace stability persists after validation returns. +## Parallel comparisons and retirement + +The owner thread authenticates records and prepares every comparison endpoint +before freezing a private view map. Four workers process independent comparisons +in batches of 32, with at most eight pending batches. Results retain input order. +Workers receive immutable prepared views, perform the same directional overlap +predicate and fresh root-relative negative probes, and cannot register paths or +collect geometry. Counter updates use locks; correctness does not depend on the +Python GIL. Positive witnesses, negative checks, and ownership exemptions are +unchanged by scheduling. + +Only the owner may control the pool or observation phase. An admission gate +covers every native batch, including work queued by a submission that raises +before returning its future. Cleanup closes admission and drains all admitted +native work before cancelling queued futures and joining the executor. A +monotonic retirement fence is checked independently before clearing prepared +views or releasing root handles. Interruptions during the drain are deferred +until native work retires. No comparison can run during sealing or after root +release, and a failed seal grants no index authority. + +A comparison error with successful cleanup can fall back to reference. Failure +to retire the pool safely raises a fatal coordinator error before reference can +authorize reconciliation. If retirement is unproved, cleanup preserves the +views and root bindings rather than releasing resources beneath a live worker. +Successful index authority requires a closed pool, zero active and pending work, +completed-comparison accounting equal to the requested count, a verified seal, +and complete native-handle closure. Shutdown and cancellation errors are not +treated as successful retirement. + ## Expiry, fallback, and operational costs Instances are local to one validation phase. Sealing disables further reads; @@ -187,11 +225,18 @@ registry inventories, name-binding checks, and opened/closed handle counts. Published diagnostics retain no unrelated journal names, claim contents, paths, or tokens. An exception records its type, not its message. -## Upgrade contract and promotion gate +## Upgrade contract and qualification gate + +Normal Windows installations automatically attempt qualified indexed validation; +other platforms continue to use reference validation. Every invocation checks +the native capabilities and certificate described above. Existing consumer +commands and CMake configuration need no changes. To force reference validation +for an existing build, set `PROTOCYTE_REGISTRY_VALIDATION=reference` in its +environment. Direct coordinator commands also accept +`--reference-registry-validation`. The environment accepts `auto` (the default) +or `reference`; unsupported values fail with a clear error. Explicit reference +selection does not require the native helper to work. -Normal installations continue to use reference validation. Neither consumer -configuration nor the hidden experiment flag can override the closed promotion -guard. Only a future reviewed source change after qualification can promote it. Packaging installs the additional trusted sibling Python helper, without requiring a new consumer command or runtime dependency. Protocol v1, plan serialization, claim tokens, @@ -205,7 +250,7 @@ skipping the record. Valid registries need no migration, reset, regeneration, or token rotation. Malformed or unreadable recorded state requires its underlying problem to be repaired rather than being skipped. -Promotion remains closed until all of the following have evidence: +The parallel qualification supplies evidence for the following promotion gates: - Relevant native mutation semantics and fallback behavior are qualified for the enabled capability, with the namespace and writer boundaries above explicit. @@ -214,9 +259,14 @@ Promotion remains closed until all of the following have evidence: - **All validation**, including current plans, every retained record, fresh negatives, inventories, versions, witnesses, and handle release, reliably stays below 30 seconds at the target scale and representative layouts/contention. -- A reviewed authoritative integration preserves the mutation-time boundary. +- The authoritative integration preserves the mutation-time boundary. The + experimental branch and draft MR remain subject to code review. -The read-only candidate benchmark reports that entire candidate cost separately -from its optional reference oracle. It produces no tokens and authorizes no -reconciliation. Ordinary `commit-shadow` timings always include the mandatory -reference pass; candidate timing must never be presented as that full operation. +The read-only qualification harness reports the entire validation cost, including +plan parsing, witness verification, worker retirement, and native-handle release, +separately from its optional reference oracle. It produces no tokens and +authorizes no reconciliation. The default-mode qualification exercises ordinary +production selection with the source gate enabled. Ordinary `commit-shadow` +timings always include the mandatory reference pass; candidate timing must never +be presented as that full operation. The timing evidence covers the retained +workload and measured host, not a universal latency bound on every installation. diff --git a/docs/observation-commit-results.md b/docs/observation-commit-results.md index b8a9af6..76b2753 100644 --- a/docs/observation-commit-results.md +++ b/docs/observation-commit-results.md @@ -3,7 +3,9 @@ This is the historical synthetic qualification at commit `0fe8ad4`. Its source fingerprints and closed promotion decision are retained below. See the newer [retained consumer qualification](consumer-validation-results.md) for subsequent -real-workload measurements and the current integration decision. +serial measurements and the [parallel-probe qualification](parallel-probe-results.md) +for the current integration decision. The disabled default described below is +the historical decision for this synthetic snapshot. The index remains **disabled as an authority** on `codex/experimental-generation-engine`. The new read-set experiment has a safe diff --git a/docs/parallel-probe-results.json b/docs/parallel-probe-results.json new file mode 100644 index 0000000..e15721f --- /dev/null +++ b/docs/parallel-probe-results.json @@ -0,0 +1,2712 @@ +{ + "date": "2026-11-16", + "branch": "codex/experimental-generation-engine", + "starting_commit": "8851bde", + "privacy": "anonymous retained consumer; raw manifests, paths, tokens, ledger copies, names and logs remain private", + "decision": { + "qualified_production_index": true, + "windows_default": "auto: indexed when verified; reference fallback otherwise", + "other_platform_default": "reference", + "all_validation_threshold_seconds": 30, + "formal_samples_below_threshold": 20, + "formal_samples_total": 20, + "failed_worker_retirement": "abort before mutation; reference cannot authorize the operation", + "new_runtime_dependencies": 0, + "required_consumer_configuration_changes": 0, + "protocol_version": 1, + "migration_or_token_rotation_required": false, + "force_reference_environment": "PROTOCYTE_REGISTRY_VALIDATION=reference", + "force_reference_cli": "--reference-registry-validation" + }, + "historical_log": { + "validation_seconds": 751.875, + "lock_wait_seconds": 0.328, + "reconciliation_seconds": 1.969, + "total_seconds": 754.172, + "registry_entries": 2172, + "current_plans": 11, + "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85" + }, + "workload": { + "registry_entries": 2239, + "ledger_records": 4478, + "current_plans": 11, + "targets_per_plan": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "declared_outputs": 232, + "committed_output_files_checked": 232, + "claims_plans_snapshots_and_outputs_unchanged": true, + "snapshot_byte_identical": true, + "tokens_produced": 0, + "reconciliation_authorized": false, + "additional_claims_since_historical_run": 67, + "ntfs_volumes": 2, + "python": "3.12.9", + "windows_build": 26300, + "original_live_registry_and_locks": true, + "frozen_ledger_matches_previous_captures": true, + "fresh_process_per_sample": true, + "cold_os_cache_claimed": false, + "cache_or_security_settings_changed": false + }, + "implementation_files": { + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664", + "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4" + }, + "git_normalized_implementation_files": { + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664", + "ProtocyteOutputCoordinator.py": "88fbf0a18beab9b55a6efad4c8136bdc023834de149f7bced1715a09420948ca", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4" + }, + "source_normalization": { + "difference": "CRLF to LF only", + "files": [ + "ProtocyteOutputCoordinator.py" + ], + "all_four_ast_identical": true + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "pre_promotion_frozen_sources": { + "driver.py": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "legacy.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664", + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4" + }, + "promotion_changed_ast_nodes": [ + "OutputCoordinator", + "OutputCoordinator.__init__", + "_parse_arguments", + "main" + ], + "promotion_also_changed_constant": "_COMMITTED_INDEX_QUALIFIED: false to true", + "reference_and_mutation_methods_ast_unchanged_since_8851bde": [ + "FileLock", + "OutputCoordinator._validate_registry_reference", + "OutputCoordinator.reconcile_set", + "OutputCoordinator._reconcile_locked", + "OutputCoordinator.validate", + "OutputCoordinator.publish", + "OutputCoordinator.reset", + "OutputCoordinator._recover", + "OutputCoordinator._apply_pending", + "OutputCoordinator._publish_one", + "OutputCoordinator._initialize_claim_locked", + "OutputCoordinator._release_claim", + "OutputCoordinator._generation_lock", + "OutputCoordinator._publication_lock" + ], + "worker_bounds": { + "workers": 4, + "batch_size": 32, + "pending_batches": 8 + }, + "loaded_series": { + "concurrent_load": "two complete legacy/current reference oracles; original geometry, frozen ledger", + "summary": { + "samples": 10, + "all_below_30_seconds": true, + "wall_seconds": { + "minimum": 23.00330879999092, + "median": 25.671646850008983, + "maximum": 27.46123300003819 + }, + "cpu_seconds": { + "minimum": 23.53125, + "median": 25.265625, + "maximum": 27.890625 + }, + "wall_samples_seconds": [ + 23.973091199994087, + 24.29418959998293, + 25.78379189997213, + 26.71369559998857, + 23.00330879999092, + 25.767325000022538, + 23.424868099973537, + 25.57596869999543, + 27.21708569995826, + 27.46123300003819 + ] + }, + "runs": [ + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 23.973091199994087, + "validation_cpu_seconds": 24.625, + "plan_parse_seconds": 0.19016100000590086, + "lock_wait_seconds": 0.3572738000075333, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 22.669190000044182, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 720736, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 24.29418959998293, + "validation_cpu_seconds": 24.078125, + "plan_parse_seconds": 0.18650770001113415, + "lock_wait_seconds": 0.35033290000865236, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 22.786057799996343, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719936, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 25.78379189997213, + "validation_cpu_seconds": 25.03125, + "plan_parse_seconds": 0.15694999997504056, + "lock_wait_seconds": 0.3303153000306338, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 24.251038999995217, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 723296, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 26.71369559998857, + "validation_cpu_seconds": 26.375, + "plan_parse_seconds": 0.21843889995943755, + "lock_wait_seconds": 0.4049413000466302, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 24.73671980004292, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 721296, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 23.00330879999092, + "validation_cpu_seconds": 23.53125, + "plan_parse_seconds": 0.15729250002186745, + "lock_wait_seconds": 0.289165000023786, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 21.528132800012827, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 720256, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 25.767325000022538, + "validation_cpu_seconds": 25.890625, + "plan_parse_seconds": 0.16689880000194535, + "lock_wait_seconds": 0.3340180000523105, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 24.27530460001435, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 720736, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 23.424868099973537, + "validation_cpu_seconds": 23.546875, + "plan_parse_seconds": 0.1567716000135988, + "lock_wait_seconds": 0.35429909999947995, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 22.0976013999898, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 721296, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 25.57596869999543, + "validation_cpu_seconds": 25.5, + "plan_parse_seconds": 0.21324660000391304, + "lock_wait_seconds": 0.35866249998798594, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 24.06260609999299, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719696, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 27.21708569995826, + "validation_cpu_seconds": 27.375, + "plan_parse_seconds": 0.18327469995711, + "lock_wait_seconds": 0.3879172000451945, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 25.566524200025015, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719696, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 27.46123300003819, + "validation_cpu_seconds": 27.890625, + "plan_parse_seconds": 0.17828970000846311, + "lock_wait_seconds": 0.3499928999808617, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 25.817237599985674, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719616, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + } + ] + }, + "enabled_default_series": { + "experimental_override_used": false, + "summary": { + "samples": 10, + "all_below_30_seconds": true, + "wall_seconds": { + "minimum": 14.48910850007087, + "median": 14.977545249916147, + "maximum": 16.53801730007399 + }, + "cpu_seconds": { + "minimum": 21.828125, + "median": 22.7421875, + "maximum": 24.734375 + }, + "wall_samples_seconds": [ + 15.682767599937506, + 14.703003100003116, + 14.951474700006656, + 14.990504799876362, + 14.964585699955933, + 14.48910850007087, + 14.834491900051944, + 15.810676700086333, + 15.464098199969158, + 16.53801730007399 + ] + }, + "runs": [ + { + "mode": "default", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": true, + "result": "accepted", + "validation_seconds": 15.682767599937506, + "validation_cpu_seconds": 22.703125, + "plan_parse_seconds": 0.0621261999476701, + "lock_wait_seconds": 0.14858510007616132, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 15.157027599983849, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 718736, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "default", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": true, + "result": "accepted", + "validation_seconds": 14.703003100003116, + "validation_cpu_seconds": 22.140625, + "plan_parse_seconds": 0.05982149997726083, + "lock_wait_seconds": 0.1445179000729695, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 14.232881500036456, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 718496, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "default", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": true, + "result": "accepted", + "validation_seconds": 14.951474700006656, + "validation_cpu_seconds": 23.234375, + "plan_parse_seconds": 0.060894700000062585, + "lock_wait_seconds": 0.1492137999739498, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 14.485082200029865, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 721216, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "default", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": true, + "result": "accepted", + "validation_seconds": 14.990504799876362, + "validation_cpu_seconds": 22.78125, + "plan_parse_seconds": 0.05553379992488772, + "lock_wait_seconds": 0.10894590010866523, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 14.536531600053422, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 722656, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "default", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": true, + "result": "accepted", + "validation_seconds": 14.964585699955933, + "validation_cpu_seconds": 22.4375, + "plan_parse_seconds": 0.06457189994398504, + "lock_wait_seconds": 0.14129389997106045, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 14.485794099979103, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 718496, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "default", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": true, + "result": "accepted", + "validation_seconds": 14.48910850007087, + "validation_cpu_seconds": 21.828125, + "plan_parse_seconds": 0.06378590001258999, + "lock_wait_seconds": 0.1175462999381125, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 14.014995499979705, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719456, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "default", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": true, + "result": "accepted", + "validation_seconds": 14.834491900051944, + "validation_cpu_seconds": 21.90625, + "plan_parse_seconds": 0.057460400043055415, + "lock_wait_seconds": 0.11687989998608828, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 14.37316620000638, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719216, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "default", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": true, + "result": "accepted", + "validation_seconds": 15.810676700086333, + "validation_cpu_seconds": 24.734375, + "plan_parse_seconds": 0.055544600007124245, + "lock_wait_seconds": 0.15205200004857033, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 15.346964599913917, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719056, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "default", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": true, + "result": "accepted", + "validation_seconds": 15.464098199969158, + "validation_cpu_seconds": 23.578125, + "plan_parse_seconds": 0.061964399996213615, + "lock_wait_seconds": 0.1372508000349626, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 14.963044699979946, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 718576, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "default", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": true, + "result": "accepted", + "validation_seconds": 16.53801730007399, + "validation_cpu_seconds": 24.203125, + "plan_parse_seconds": 0.05571410001721233, + "lock_wait_seconds": 0.10686090006493032, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 16.084514199988917, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719536, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + } + ] + }, + "preliminary_series": { + "included_in_formal_gate": false, + "summary": { + "samples": 3, + "all_below_30_seconds": true, + "wall_seconds": { + "minimum": 17.479689900006633, + "median": 17.873306899971794, + "maximum": 18.5645825000247 + }, + "cpu_seconds": { + "minimum": 21.8125, + "median": 22.71875, + "maximum": 23.625 + }, + "wall_samples_seconds": [ + 18.5645825000247, + 17.479689900006633, + 17.873306899971794 + ] + }, + "runs": [ + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "516ebaf90bd1abd475b66e487b721578d516589befe849a3b1b44697b4d48668", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "0f29248142e0d4eefbea834ec5f616e3d2a7dce0f280fe222b3a29b99dff2ed5" + }, + "qualification_driver_sha256": "e959178ea2880fdf0661db18be384aba23ae6ef1386e630ebf80a6308220d40b", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 18.5645825000247, + "validation_cpu_seconds": 23.625, + "plan_parse_seconds": 0.11295179999433458, + "lock_wait_seconds": 0.24943399999756366, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 17.635164300038014, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719536, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "516ebaf90bd1abd475b66e487b721578d516589befe849a3b1b44697b4d48668", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "0f29248142e0d4eefbea834ec5f616e3d2a7dce0f280fe222b3a29b99dff2ed5" + }, + "qualification_driver_sha256": "e959178ea2880fdf0661db18be384aba23ae6ef1386e630ebf80a6308220d40b", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 17.479689900006633, + "validation_cpu_seconds": 21.8125, + "plan_parse_seconds": 0.08638719998998567, + "lock_wait_seconds": 0.19532140000956133, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 16.81076399999438, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719616, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "516ebaf90bd1abd475b66e487b721578d516589befe849a3b1b44697b4d48668", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "0f29248142e0d4eefbea834ec5f616e3d2a7dce0f280fe222b3a29b99dff2ed5" + }, + "qualification_driver_sha256": "e959178ea2880fdf0661db18be384aba23ae6ef1386e630ebf80a6308220d40b", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 17.873306899971794, + "validation_cpu_seconds": 22.71875, + "plan_parse_seconds": 0.08108989999163896, + "lock_wait_seconds": 0.24072529998375103, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 17.10248960001627, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719376, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + } + ] + }, + "reference_oracles": [ + { + "mode": "legacy", + "implementation_files": { + "driver.py": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "legacy.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664", + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4" + }, + "original_workload": true, + "frozen_sources": true, + "result": "accepted", + "registry_entries": 2239, + "claims_checked": 2239, + "validation_seconds": 934.7074909000075, + "validation_cpu_seconds": 661.359375, + "frozen_ledger": true, + "original_output_paths": true, + "original_namespace_checked_separately": true, + "live_shared_lock_held": false, + "ownership_or_output_mutations": 0 + }, + { + "mode": "reference", + "implementation_files": { + "driver.py": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "legacy.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664", + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4" + }, + "original_workload": true, + "frozen_sources": true, + "result": "accepted", + "registry_entries": 2239, + "claims_checked": 2239, + "validation_seconds": 707.3523126000073, + "validation_cpu_seconds": 479.59375, + "frozen_ledger": true, + "original_output_paths": true, + "original_namespace_checked_separately": true, + "live_shared_lock_held": false, + "ownership_or_output_mutations": 0 + } + ], + "preservation": { + "mode": "audit", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "index_authorization_enabled": true, + "registry_entries": 2239, + "committed_output_files_checked": 232, + "claims_plans_snapshots_outputs_and_mtimes_unchanged": true, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + "comparisons": { + "exact_historical_baseline_seconds": 751.875, + "default_median_speedup": 50.20014878634464, + "default_median_percent_less_time": 98.00797403159885, + "approximate_700_second_baseline_speedup": 46.73663062402826, + "loaded_worst_speedup_over_exact_baseline": 27.379506229707687, + "controlled_algorithm_only_comparison": false + }, + "verification": { + "final_source_passes": [ + { + "check": "Ruff: all touched Python source and tests", + "passed": true + }, + { + "check": "CPython 3.14.4 complete default suite, four pytest processes", + "passed": 1927, + "skipped": 41 + }, + { + "check": "Explicit indexed coordinator suite", + "passed": 89, + "skipped": 6 + }, + { + "check": "Minimum Python 3.12.9: parallel, native, qualifier, ownership and path tests", + "passed": 201 + }, + { + "check": "CMake packaging and integration", + "passed": 22, + "skipped": 1 + }, + { + "check": "Python 3.12.9 cross-version upgrade, rollback and crash recovery", + "passed": 111 + } + ], + "cross_version_upgrade": { + "scope": "isolated Windows cross-version checks; no consumer registry accessed", + "legacy_git_blob": "25f1660190d3d1015fef3955814c8c737bd686c5", + "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", + "candidate_coordinator_sha256": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "candidate_helper_sha256": { + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "unchanged_ast_methods_since_checkpoint": [ + "reconcile_set", + "_reconcile_locked", + "validate", + "publish", + "reset", + "_recover", + "_apply_pending", + "_publish_one", + "_initialize_claim_locked", + "_release_claim", + "_generation_lock", + "_publication_lock" + ], + "reference_validator_ast_unchanged_since_checkpoint": false, + "file_lock_ast_unchanged_since_checkpoint": true, + "passed_cases": 111, + "production_index_authorization_qualified": true, + "index_authority_enabled_only_in_isolated_fixture_module": false, + "indexed_validations": 32, + "index_authorized_validations": 30, + "indexed_reference_fallbacks": 2, + "cases": [ + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "reference", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "reference", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "shadow", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "native-shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "native-shadow", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "commit-shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "commit-shadow", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "indexed", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "indexed", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "default", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "default", + "reader": "old", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + } + ] + }, + "parallel_probe_tests": 64, + "randomized_serial_parallel_differential_cases": 1024, + "test_case_serialization": "quiet native tests and CLI/integration cases share a test-only mutex; intentional concurrency inside cases is preserved", + "cpp_files_touched": 0 + }, + "limits": [ + "Target-workload qualification on one Windows/NTFS host, not a universal latency or platform-matrix guarantee.", + "Fresh processes reuse the workload and OS caches; no cold-cache guarantee.", + "Whole validation includes current-plan parsing, complete retained-record authentication, both-direction fresh comparisons, inventories, witnesses, worker retirement and native-handle release.", + "Registry/generation/publication lock wait is separate; observer mutex wait is included in validation.", + "Live qualification forbids reconciliation/publication/reset and creates no tokens; mutation behavior is qualified in isolated upgrade/integration tests.", + "USN witness posting changes counted journal metadata, not ownership records, file contents or names.", + "Capability, witness, namespace, alias, resource-budget or ordinary comparison failure after safe cleanup runs full reference validation and can exceed 30 seconds.", + "Failed worker retirement aborts the operation before mutation, preserving bindings until native retirement is proved.", + "No atomic namespace freeze or guarantee against noncooperative record writers; existing mutation-time checks and v1 writer locks remain necessary." + ] +} diff --git a/docs/parallel-probe-results.md b/docs/parallel-probe-results.md new file mode 100644 index 0000000..ae0bdc0 --- /dev/null +++ b/docs/parallel-probe-results.md @@ -0,0 +1,203 @@ +# Parallel-probe qualification + +**Passed: 20/20 complete validations below 30 seconds.** The experimental +branch now automatically uses the committed index on qualified Windows +invocations. The enabled default took **14.489–16.538 seconds**, with a +**14.978-second median**. Ten additional samples while two complete reference +oracles ran concurrently took **23.003–27.461 seconds**. Every sample accepted +the entire retained workload with verified end witnesses, fully retired workers, +balanced native handles, and no reference fallback. + +The default median is **50.20 times faster (98.01% less time)** than the +exact historical **751.875-second validation**, or +**46.74 times faster** than an approximate 700-second baseline. +These compare distinct observed runs, not controlled estimates of the algorithm +alone. They do not include reconciliation or promise the same latency on every +host. The previous [serial timing gate](consumer-validation-results.md) remains +recorded as a failure; these results come from a new parallel implementation. + +## Complete workload and measurement boundary + +This is the original anonymous consumer configuration, with **11 current plans**, +one target each, **232 generated files**, **2,239 retained claims**, and +**4,478 claim/plan records** on two NTFS volumes. The historical log had 2,172 +claims: all 67 additional claims remain present. No registry was pruned, split, +reset, replaced, or moved to a new lock namespace. Frozen ledger hashes match +the previous qualification captures exactly. + +Each live sample uses CPython 3.12.9 on Windows build 26300 in a fresh process, +acquires the original registry/generation/publication locks, parses the original +current plans, checks their complete plan set, and runs the production registry +validation entry point. The timer includes those plan checks, every retained +record, index construction, fresh directional negative probes, inventories, +name bindings, versions, exact close witnesses, worker retirement, and native +handle release. Registry/generation/publication lock wait is reported separately; +observer-mutex wait is included. OS caches and the workload are reused. No +cold-cache claim is made, and no cache or security settings were changed. + +The first formal series kept the source promotion guard closed: only the +mutation-forbidden qualification module enabled its own indexed entry point. +After that series passed, the enabled-default series used the actual default +constructor and source guard, without an experimental flag or qualification +override. All twenty samples exercised production validation code. The harness +forbids reconciliation, recovery, publication, reset, and durable record writes; +it issues no tokens. Mutation behavior is tested separately in isolated builds. + +## All formal samples + +| Sample | Loaded validation | Enabled default | Default CPU | +| --- | ---: | ---: | ---: | +| 1 | 23.973 s | 15.683 s | 22.703 s | +| 2 | 24.294 s | 14.703 s | 22.141 s | +| 3 | 25.784 s | 14.951 s | 23.234 s | +| 4 | 26.714 s | 14.991 s | 22.781 s | +| 5 | 23.003 s | 14.965 s | 22.438 s | +| 6 | 25.767 s | 14.489 s | 21.828 s | +| 7 | 23.425 s | 14.834 s | 21.906 s | +| 8 | 25.576 s | 15.811 s | 24.734 s | +| 9 | 27.217 s | 15.464 s | 23.578 s | +| 10 | 27.461 s | 16.538 s | 24.203 s | + +Loaded median: **25.672 seconds**. Default CPU median: +**22.742 seconds**, range **21.828–24.734**. +Parallelism spends additional CPU to reduce elapsed time. The earlier paired +prototype measured 22.266 CPU seconds in parallel versus 18.500 serial; that +historical pair is feasibility evidence, not a controlled comparison for the +hardened implementation. Three preliminary hardened-development samples +(18.565, 17.480, 17.873 seconds) are retained in the JSON, excluded from the +formal twenty-sample gate because the native helper was subsequently hardened. + +Every formal sample retains the following work: + +| Check | Count per validation | +| --- | ---: | +| Authenticated claim/plan records | 4,478 | +| Fresh reservation comparisons | 84,579 | +| Fresh negative probes | 261,703 | +| Full registry inventories | 2 | +| Forced close posts / exact end witnesses | 17,958 / 8,979 | +| Native handles opened / closed | 26,916 / 26,916 | +| Worker batches submitted / started / finished | 2,662 / 2,662 / 2,662 | +| Worker / pending-batch peaks | 4 / 8 | +| Active / pending work at return | 0 / 0 | + +## Independent acceptance and preservation + +Both complete reference oracles accepted all 2,239 claims: the exact historical +coordinator took **934.707 seconds**, and the branch reference validator took +**707.352 seconds**. They ran concurrently with each other and the loaded native +series. These elapsed times describe reader contention, not controlled speedup +ratios. The slow oracles validate byte-identical ledger copies captured under +the original locks, retain the original build/output/staging geometry, filter +no foreign records, and separately execute original lock-namespace checks. They +do not hold the live shared registry lock for their long reference passes. + +The post-series audit verified unchanged original claim/plan bytes, current +snapshots, and all **232 generated-file hashes and mtimes**. No ownership/output +mutation, reconciliation, publication, reset, or token creation occurred in live +qualification. Native observation still posts counted USN journal metadata; +it does not alter file contents or names. Raw paths, names, ledger copies, +tokens, manifests, and logs remain in ignored local evidence. + +## Scheduling and correctness + +The owner authenticates records and freezes all prepared endpoint views before +creating work. Four workers perform independent comparisons in batches of 32, +with at most eight pending batches, preserving result order. Workers cannot +register paths, collect geometry, or mutate the read-set maps. Missing endpoints +are still freshly checked in both comparison directions and during sealing. +No negative result is cached as stable. Counters use explicit synchronization. + +An admission gate covers even a task queued by a failing submission. Cleanup +closes admission and drains admitted native work before executor cancellation +and joining. The retirement fence is independently required before erasing +views, closing root handles, or sealing. Worker, submission, shutdown, +and interruption failures have explicit tests. Unproved retirement +retains bindings and aborts before any reference result can authorize mutation. + +Index authority requires every positive USN witness, complete inventory/name +checks, fully closed native handles, a retired pool with zero pending/active +work, and exact comparison accounting. The [contract](observation-commit-contract.md) +retains the positive-version argument, noncanonical/case-sensitive alias +boundaries, fresh-negative semantics, and cooperative-writer assumptions. + +## Final-source qualification + +| Check | Result | +| --- | --- | +| Complete CPython 3.14.4 suite, `pytest -q -n 4` | 1,927 passed, 41 skipped | +| Explicit indexed coordinator suite | 89 passed, 6 skipped | +| Minimum CPython 3.12.9 native/index/parallel/qualifier tests | 201 passed | +| CMake packaging and integration | 22 passed, 1 skipped | +| Old/new upgrade, rollback, publication, crash recovery | 111 passed | +| Ruff on touched Python files | Passed | + +The parallel suite contains 64 tests, including 1,024 randomized serial/parallel +ownership and retirement comparisons; all batch boundaries; real simultaneous +workers; reverse-direction file/dangling-junction races; real caller +impersonation; uncertain/emulated process contexts; late/untracked submission; +worker/shutdown/wait interruptions; preserved bindings when retirement is +unproved; incomplete certificates; previous-helper fallback; and token +preservation. Existing native ABA, alias, metadata, malformed-record, +concurrency, crash-cut and packaging checks remain in the full qualification. + +Quiet native test cases and default-enabled CLI/integration cases share a +test-only mutex so their own USN markers do not invalidate each other on +common volume ancestors. Deliberate threads/processes inside each case remain +concurrent. This does not replace or alter production ownership locks. One +test-harness race in the injected-wait handshake was corrected to wait for +the actual injected interruption before releasing the blocked worker. + +## Upgrades and failure boundaries + +Existing CMake commands keep working. Packaging installs the trusted sibling +helpers; no service, administrator setup, new Python dependency, registry +migration, reset, or claim-token rotation is required. The shared v1 lock +namespace, records, plan format, publication and recovery protocol stay the +same. All 111 cross-version checks use the final enabled source, including +old/default and default/old operation and crash recovery. Core mutation and +lock methods are AST-identical to the preservation checkpoint. The prior +recorded-plan `lstat` correctness fix still rejects malformed/dangling or +unreadable state rather than silently skipping it; valid ledgers need no repair. + +Automatic indexed validation requires native 64-bit Windows process context, +ordinary non-impersonating execution, local NTFS DOS paths, an existing usable +journal, exact supported observations, and the resource budgets in the contract. +Other platforms and unsupported capabilities use reference. Namespace changes, +aliases, dirty/missing witnesses, journal churn, external marker collisions, +and ordinary comparison failures after safe cleanup also use full reference +validation, which can exceed 30 seconds. Failed worker retirement aborts before +mutation. A broken native certificate never licenses an indexed acceptance. + +To force reference validation in an existing build, set +`PROTOCYTE_REGISTRY_VALIDATION=reference` in its environment; direct coordinator +commands also accept `--reference-registry-validation`. No configuration is +needed for normal use. Partial/mixed helper installations safely fall back +when their trusted API cannot supply the required complete certificate. + +This is evidence for the retained workload and tested Windows/NTFS host. +It does not prove a universal bound under cold caches, all filesystem filters, +or arbitrary machine load. Observation certifies past positive intervals, not +a namespace freeze or future stability. The existing cooperative-writer trust +model and mutation-time checks remain necessary. + +## Source provenance + +Qualification started at `8851bde`. The frozen pre-promotion native helper is +byte-identical to the enabled helper. Promotion changed automatic selection, +the qualification constant, and CLI default wiring in the coordinator; +its reference validator, lock class, and mutation methods are AST-identical +to the frozen oracle and starting checkpoint. Full final-source tests and the +enabled-default timing series ran after promotion. + +| Final implementation | As-run SHA-256 | +| --- | --- | +| `ProtocyteObservationCommit.py` | `143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664` | +| `ProtocyteOutputCoordinator.py` | `8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10` | +| `ProtocyteOwnershipIndex.py` | `7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38` | +| `ProtocytePathObservation.py` | `a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4` | + +The [machine-readable report](parallel-probe-results.json) retains every formal +run and counter, the preliminary samples, reference receipts, preservation +audit, final upgrade receipt, frozen oracle fingerprints, and Git-normalized +source hashes. Normalization changes CRLF to LF only, with identical ASTs. diff --git a/docs/wiki/Contributing.md b/docs/wiki/Contributing.md index 2b569c5..ef551b1 100644 --- a/docs/wiki/Contributing.md +++ b/docs/wiki/Contributing.md @@ -123,7 +123,14 @@ Both tools record the coordinator/helper fingerprints and reject source changes during a measurement. See the experiment's [results](../experimental-index-results.md) and [correctness contract](../experimental-index-contract.md) before interpreting -the preview numbers. The default coordinator remains reference mode. +the preview numbers. That sampled experiment always retains reference authority. +The subsequent committed index is now the automatic Windows default when native +capabilities and its complete certificate are verified; see the +[parallel qualification](../parallel-probe-results.md) and +[observation contract](../observation-commit-contract.md). Unsupported or +unverified observations fall back to reference validation. Set +`PROTOCYTE_REGISTRY_VALIDATION=reference` to compare an existing build using the +reference path. The fresh native-reader investigation can be measured with `--registry-validation native-shadow` in the scaling benchmark or POC. It keeps diff --git a/docs/wiki/Troubleshooting.md b/docs/wiki/Troubleshooting.md index 43a1c9f..469dfdc 100644 --- a/docs/wiki/Troubleshooting.md +++ b/docs/wiki/Troubleshooting.md @@ -208,6 +208,15 @@ wait includes preparing and acquiring its lock files. `registry_entries` counts state directories, including any abandoned initialization directories encountered; `claims_checked` counts authenticated claim/plan records. +On supported Windows/NTFS installations, registry validation automatically uses +the qualified committed index. Unsupported capabilities or an unverified +observation use full reference validation, which can take longer. Existing +builds need no migration, registry reset, or new configuration. To force the +reference validator while diagnosing an installation, set +`PROTOCYTE_REGISTRY_VALIDATION=reference` in the build environment; remove it to +restore automatic selection. See the +[qualification and limits](../parallel-probe-results.md). + If cleanup refuses an unsafe path or cannot remove it, the diagnostic warns that inert staging data outside `OUT_DIR` may remain. Stop related processes and remove only the named staging path after inspecting it. ## Adding a Proto File Does Not Generate It diff --git a/tests/conftest.py b/tests/conftest.py index 33f00e8..88786b7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,11 +3,54 @@ from __future__ import annotations import os +import importlib.util +import sys from pathlib import Path import pytest +_lock_module = None + + +@pytest.fixture(autouse=True) +def quiet_registry_observers(request: pytest.FixtureRequest): + # Quiet certificate tests and default-enabled CLI subprocesses share volume + # ancestors. Serialize *test cases*, while preserving each case's deliberate + # worker/process concurrency. This does not alter production lock selection. + files = { + "test_output_coordinator.py", + "test_ownership_index.py", + "test_observation_commit.py", + "test_parallel_probes.py", + "test_path_observation.py", + "test_consumer_registry_qualification.py", + } + if ( + request.node.path.name not in files + and request.node.get_closest_marker("cmake_integration") is None + ): + yield + return + global _lock_module + if _lock_module is None: + source = ( + Path(__file__).resolve().parents[1] / "cmake/ProtocyteOutputCoordinator.py" + ) + spec = importlib.util.spec_from_file_location( + "protocyte_test_observer_lock", source + ) + assert spec and spec.loader + _lock_module = importlib.util.module_from_spec(spec) + sys.modules[spec.name] = _lock_module + exec(compile(source.read_bytes(), str(source), "exec"), _lock_module.__dict__) + base = request.getfixturevalue("tmp_path_factory").getbasetemp() + if getattr(request.config, "workerinput", None) is not None: + base = base.parent + with _lock_module.FileLock(base / "observation-commit-tests.lock"): + yield + + @pytest.fixture(autouse=True) def isolated_cmake_registry_cache( request: pytest.FixtureRequest, diff --git a/tests/test_consumer_registry_qualification.py b/tests/test_consumer_registry_qualification.py index 8ac69d8..f68b709 100644 --- a/tests/test_consumer_registry_qualification.py +++ b/tests/test_consumer_registry_qualification.py @@ -149,7 +149,7 @@ def test_indexed_qualification_requires_mutation_guard_and_restores_promotion_ga ) -> None: module, engine, _, _, _, manifest, work = seeded(tmp_path) before = driver.ledger(engine.lock_root) - assert module._COMMITTED_INDEX_QUALIFIED is False + qualified = module._COMMITTED_INDEX_QUALIFIED def certificate(self, *args, **kwargs): assert module._COMMITTED_INDEX_QUALIFIED is True @@ -163,6 +163,15 @@ def certificate(self, *args, **kwargs): commit_handles_opened=1, commit_handles_closed=1, commit_claims_checked=1, + commit_probe_state="closed", + commit_probe_native_retired=True, + commit_probe_active=0, + commit_probe_pending=0, + commit_probe_comparisons=0, + commit_fresh_comparisons=0, + commit_probe_workers=4, + commit_probe_peak_active=0, + commit_probe_peak_pending=0, ) return True @@ -175,6 +184,6 @@ def certificate(self, *args, **kwargs): else: receipt = driver.candidate(module, manifest, work, integrated=True) assert receipt["native_metrics"]["authoritative"] == "index" - assert module._COMMITTED_INDEX_QUALIFIED is False + assert module._COMMITTED_INDEX_QUALIFIED is qualified assert driver.ledger(engine.lock_root) == before assert not (tmp_path / "forbidden").exists() diff --git a/tests/test_observation_commit.py b/tests/test_observation_commit.py index 7e1bdce..de992c3 100644 --- a/tests/test_observation_commit.py +++ b/tests/test_observation_commit.py @@ -27,17 +27,9 @@ @pytest.fixture(autouse=True) -def quiet_native_commit_cases(request, tmp_path_factory, monkeypatch): - # Close-marker posts are deliberately treated as version changes, including - # posts by another observer. Give quiet-baseline tests a private session gate; - # the explicit overlap test below exercises invalidation instead. - base = tmp_path_factory.getbasetemp() - if getattr(request.config, "workerinput", None) is not None: - base = base.parent +def qualify_native_commit_cases(monkeypatch): # Exercise the guarded success path only in isolated test fixtures. monkeypatch.setattr(coordinator, "_COMMITTED_INDEX_QUALIFIED", True) - with coordinator.FileLock(base / "observation-commit-tests.lock"): - yield @pytest.fixture @@ -699,6 +691,14 @@ def test_indexed_incomplete_certificate_runs_reference_before_mutation( plan = _plan(tmp_path, "current") def incomplete(*args, **kwargs): + engine.validation_metrics.update( + commit_probe_state="closed", + commit_probe_native_retired=True, + commit_probe_active=0, + commit_probe_pending=0, + commit_probe_comparisons=0, + commit_fresh_comparisons=0, + ) engine.validation_metrics.update(certificate) return True diff --git a/tests/test_output_coordinator.py b/tests/test_output_coordinator.py index 99ce5f4..b10f69c 100644 --- a/tests/test_output_coordinator.py +++ b/tests/test_output_coordinator.py @@ -28,15 +28,14 @@ def _load_coordinator() -> ModuleType: if test_mode == "indexed": # This module is used exclusively by isolated test registries. module._COMMITTED_INDEX_QUALIFIED = True - if test_mode != "reference": - original_initialize = module.OutputCoordinator.__init__ + original_initialize = module.OutputCoordinator.__init__ - def initialize( - self: object, lock_root: Path, *, registry_validation: str = test_mode - ) -> None: - original_initialize(self, lock_root, registry_validation=registry_validation) + def initialize( + self: object, lock_root: Path, *, registry_validation: str | None = test_mode + ) -> None: + original_initialize(self, lock_root, registry_validation=test_mode if registry_validation is None else registry_validation) - module.OutputCoordinator.__init__ = initialize + module.OutputCoordinator.__init__ = initialize return module @@ -1955,12 +1954,12 @@ def overlap(first: Path, second: Path) -> bool: monkeypatch.setattr(coordinator, "_paths_overlap", overlap) if engine.registry_validation == "indexed" and os.name == "nt": scope_type = coordinator._load_observation_commit().WindowsObservationCommit - native_overlap = scope_type.overlaps + native_overlap = scope_type._overlaps_views - def indexed_overlap(self: object, first: Path, second: Path) -> bool: - return replace_retained_root(first, second, native_overlap(self, first, second)) + def indexed_overlap(self: object, first: object, second: object) -> bool: + return replace_retained_root(first.path, second.path, native_overlap(self, first, second)) - monkeypatch.setattr(scope_type, "overlaps", indexed_overlap) + monkeypatch.setattr(scope_type, "_overlaps_views", indexed_overlap) with pytest.raises(coordinator.CoordinatorError, match="symbolic link or junction"): engine.reconcile_set((), current) assert changed diff --git a/tests/test_output_coordinator_cmake.py b/tests/test_output_coordinator_cmake.py index 91b00ed..1a6f4ec 100644 --- a/tests/test_output_coordinator_cmake.py +++ b/tests/test_output_coordinator_cmake.py @@ -1,6 +1,7 @@ from __future__ import annotations import json +import ast import hashlib import importlib.util import os @@ -66,6 +67,7 @@ def test_default_registry_selector_uses_the_isolated_test_cache(tmp_path: Path) "experimental_flag", [ None, + "--reference-registry-validation", "--experimental-registry-index", "--experimental-native-observation", "--experimental-observation-commit", @@ -134,7 +136,10 @@ def encoded(path: Path | str) -> str: capture_output=True, text=True, ) - if experimental_flag == "--experimental-committed-index": + tree = ast.parse(script.read_bytes()) + qualified = next(node.value.value for node in tree.body if isinstance(node, ast.Assign) + and any(isinstance(target, ast.Name) and target.id == "_COMMITTED_INDEX_QUALIFIED" for target in node.targets)) + if experimental_flag == "--experimental-committed-index" and not qualified: assert result.returncode == 1, result.stdout + result.stderr assert "not qualified for consumer use" in result.stderr assert not result.stdout diff --git a/tests/test_parallel_probes.py b/tests/test_parallel_probes.py new file mode 100644 index 0000000..091d1a1 --- /dev/null +++ b/tests/test_parallel_probes.py @@ -0,0 +1,612 @@ +from __future__ import annotations + +import importlib.util +import itertools +import ctypes +import os +import random +import sys +import subprocess +import threading +from pathlib import Path + +import pytest + + +spec = importlib.util.spec_from_file_location( + "parallel_probe_helpers", Path(__file__).with_name("test_output_coordinator.py") +) +assert spec and spec.loader +helpers = importlib.util.module_from_spec(spec) +sys.modules[spec.name] = helpers +spec.loader.exec_module(helpers) +coordinator = helpers.coordinator +commit = coordinator._load_observation_commit() +model = coordinator._load_ownership_index() +_modules = itertools.count() + + +@pytest.fixture(autouse=True) +def qualify_native_cases(monkeypatch): + monkeypatch.setattr(coordinator, "_COMMITTED_INDEX_QUALIFIED", True) + + +@pytest.fixture +def scope(tmp_path): + if os.name != "nt": + pytest.skip("native root-relative comparisons require Windows") + result = commit.WindowsObservationCommit( + coordinator._load_path_observation(), model + ) + try: + result.project(tmp_path) + # Qualify the transport separately, then use a new read set for tests. + result.seal() + except commit.CapabilityUnavailable as error: + pytest.skip(str(error)) + finally: + result.close() + result = commit.WindowsObservationCommit( + coordinator._load_path_observation(), model + ) + try: + yield result + finally: + result.close() + metrics = result.metrics() + assert metrics["commit_handles_opened"] == metrics["commit_handles_closed"] + + +@pytest.mark.parametrize("workers", [1, 2, 4]) +@pytest.mark.parametrize("size", [0, 1, 31, 32, 33, 257]) +def test_bounded_batches_preserve_order_and_retire(workers, size): + session = commit.ProbeSession(lambda number: number % 3 == 0, workers=workers) + try: + assert session.compare((number, number) for number in range(size)) == list( + range(0, size, 3) + ) + finally: + session.close() + metrics = session.metrics() + assert metrics["commit_probe_state"] == "closed" + assert metrics["commit_probe_active"] == metrics["commit_probe_pending"] == 0 + assert metrics["commit_probe_comparisons"] == size + assert ( + metrics["commit_probe_batches_started"] + == metrics["commit_probe_batches_finished"] + ) + assert metrics["commit_probe_peak_pending"] <= workers * 2 + assert metrics["commit_probe_peak_active"] <= workers + assert metrics["commit_probe_threads"] <= workers + with pytest.raises(commit.ObservationChanged, match="after retirement"): + session.compare([(0, 0)]) + + +def raw_coordinator(): + source = Path(__file__).resolve().parents[1] / "cmake/ProtocyteOutputCoordinator.py" + specification = importlib.util.spec_from_file_location( + f"parallel_default_{next(_modules)}", source + ) + module = importlib.util.module_from_spec(specification) + sys.modules[specification.name] = module + specification.loader.exec_module(module) + return module + + +@pytest.mark.parametrize("qualified", [False, True]) +@pytest.mark.parametrize("selection", [None, "auto", "reference", "REFERENCE", ""]) +def test_automatic_default_and_simple_reference_escape_hatch( + tmp_path, monkeypatch, qualified, selection +): + module = raw_coordinator() + monkeypatch.setattr(module, "_COMMITTED_INDEX_QUALIFIED", qualified) + if selection is None: + monkeypatch.delenv("PROTOCYTE_REGISTRY_VALIDATION", raising=False) + else: + monkeypatch.setenv("PROTOCYTE_REGISTRY_VALIDATION", selection) + engine = module.OutputCoordinator(tmp_path / "locks") + expected = ( + "indexed" + if qualified and os.name == "nt" and selection not in ("reference", "REFERENCE") + else "reference" + ) + assert engine.registry_validation == expected + + +def test_invalid_default_override_is_rejected_and_explicit_reference_recovers( + tmp_path, monkeypatch +): + module = raw_coordinator() + monkeypatch.setenv("PROTOCYTE_REGISTRY_VALIDATION", "unrecognized") + locks = tmp_path / "locks" + with pytest.raises(module.CoordinatorError, match="must be auto or reference"): + module.OutputCoordinator(locks) + assert not locks.exists() + assert ( + module.OutputCoordinator( + locks, registry_validation="reference" + ).registry_validation + == "reference" + ) + + +@pytest.mark.parametrize( + "override", + [ + {"commit_probe_state": "active"}, + {"commit_probe_state": "failed"}, + {"commit_probe_native_retired": False}, + {"commit_probe_native_retired": 1}, + {"commit_probe_active": 1}, + {"commit_probe_active": False}, + {"commit_probe_pending": 1}, + {"commit_probe_pending": False}, + {"commit_probe_comparisons": 1}, + {"commit_probe_comparisons": False}, + ], +) +def test_incomplete_worker_accounting_cannot_authorize_mutation( + tmp_path, monkeypatch, override +): + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="indexed" + ) + plan = helpers._write_plan( + tmp_path / "plan", + tmp_path / "generated", + tmp_path / "build", + ((helpers._target("worker-accounting"), "sample.protocyte.hpp"),), + ) + + def incomplete(*args, **kwargs): + engine.validation_metrics.update( + commit_certificate="verified", + commit_state="closed", + commit_handles_opened=2, + commit_handles_closed=2, + commit_probe_state="closed", + commit_probe_native_retired=True, + commit_probe_active=0, + commit_probe_pending=0, + commit_probe_comparisons=0, + commit_fresh_comparisons=0, + ) + engine.validation_metrics.update(override) + return True + + monkeypatch.setattr(engine, "_preview_committed_index", incomplete) + assert engine.reconcile(plan) + assert engine.validation_metrics["authoritative"] == "reference" + assert engine.validation_metrics["reference_result"] == "accepted" + + +def test_workers_overlap_and_cannot_control_the_session(): + rendezvous = threading.Barrier(4) + entered = threading.local() + session = None + + def compare(number): + if not getattr(entered, "ready", False): + entered.ready = True + rendezvous.wait(timeout=5) + with pytest.raises(commit.ObservationChanged, match="control used by a worker"): + session.close() + return False + + session = commit.ProbeSession(compare) + try: + assert session.compare((number, number) for number in range(256)) == [] + finally: + session.close() + assert session.metrics()["commit_probe_peak_active"] == 4 + assert session.metrics()["commit_probe_threads"] == 4 + + +@pytest.mark.parametrize("error_type", [RuntimeError, KeyboardInterrupt, SystemExit]) +@pytest.mark.parametrize("site", ["worker", "submit-after-queue", "shutdown", "wait"]) +def test_every_failure_drains_admitted_work(error_type, site): + first_started = threading.Event() + second_started = threading.Event() + failed = threading.Event() + wait_interrupted = threading.Event() + release = threading.Event() + finished = threading.Event() + errors, sessions, actual_shutdowns = [], [], [] + + def compare(number): + if number == 0: + first_started.set() + assert second_started.wait(5) + if site in ("worker", "shutdown", "wait"): + failed.set() + raise error_type("injected worker failure") + assert release.wait(5) + elif number == 32: + second_started.set() + assert release.wait(5) + return False + + def control(): + session = commit.ProbeSession(compare, workers=2) + sessions.append(session) + real_submit = session._executor.submit + real_shutdown = session._executor.shutdown + actual_shutdowns.append(real_shutdown) + if site == "submit-after-queue": + submissions = 0 + + def submit(*args, **kwargs): + nonlocal submissions + future = real_submit(*args, **kwargs) + submissions += 1 + if submissions == 2: + assert second_started.wait(5) + failed.set() + raise error_type("submit queued work before failing") + return future + + session._executor.submit = submit + if site == "shutdown": + + def shutdown(**kwargs): + raise error_type("injected shutdown failure") + + session._executor.shutdown = shutdown + if site == "wait": + real_wait = session._condition.wait + interrupted = False + + def wait(*args, **kwargs): + nonlocal interrupted + if not interrupted: + interrupted = True + wait_interrupted.set() + raise error_type("injected interruption while draining") + return real_wait(*args, **kwargs) + + session._condition.wait = wait + try: + session.compare((number, number) for number in range(128)) + except BaseException as error: + errors.append(error) + finally: + try: + session.close() + except BaseException: + pass + finished.set() + + thread = threading.Thread(target=control) + thread.start() + try: + assert first_started.wait(5) and second_started.wait(5) and failed.wait(5) + if site == "wait": + assert wait_interrupted.wait(5) + assert not finished.is_set(), ( + "retired a session with an admitted query still active" + ) + assert sessions[0].metrics()["commit_probe_active"] >= 1 + finally: + release.set() + thread.join(timeout=10) + for shutdown in actual_shutdowns: + shutdown(wait=True, cancel_futures=True) + assert not thread.is_alive() and finished.is_set() + assert len(errors) == 1 + expected = ( + commit.ProbeCleanupFailed + if site in ("shutdown", "wait") and error_type is RuntimeError + else error_type + ) + assert isinstance(errors[0], expected) + session = sessions[0] + assert session.metrics()["commit_probe_active"] == 0 + assert session.metrics()["commit_probe_pending"] == 0 + assert session.native_retired is True + # Even a job hidden by a failed submit cannot read prepared facts after close. + with pytest.raises(commit.ObservationChanged, match="after retirement"): + session._run(object()) + + +def test_parallel_index_matches_serial_on_randomized_ownership_and_retirement(): + def overlaps(pair): + left, right = pair + return ( + left.portable == right.portable + or left.portable.startswith(right.portable + "/") + or right.portable.startswith(left.portable + "/") + or left.location in right.ancestors + or right.location in left.ancestors + ) + + session = commit.ProbeSession(overlaps) + randomizer = random.Random(54) + try: + for _ in range(64): + facts, stable = {}, {} + paths = [Path(f"path-{number}") for number in range(96)] + for path in paths: + parent, leaf = randomizer.randrange(8), randomizer.randrange(8) + location = (7, parent * 8 + leaf + 2, ()) + ancestors = (location, (7, parent + 100, ()), (7, 1, ())) + facts[path] = model.DirectoryObservation( + f"/p{parent}/p{leaf}", location, ancestors + ) + stable[path] = randomizer.choice((True, False)) + + class Serial: + def is_stable(self, path): + return stable[path] + + def facts(self, path): + return facts[path] + + def overlaps(self, first, second): + return overlaps((facts[first], facts[second])) + + class Parallel(Serial): + probe_session = session + + def prepare_overlap(self, first, second): + return facts[first], facts[second] + + entries = [ + ( + model.Reservation( + randomizer.choice(("root", "staging")), + f"k{randomizer.randrange(8)}", + f"b{randomizer.randrange(2)}", + f"t{randomizer.randrange(2)}", + facts[path], + ), + path, + stable[path], + ) + for path in paths[:64] + ] + for _ in range(16): + arguments = dict( + root=randomizer.choice(paths), + root_key=f"k{randomizer.randrange(8)}", + build_id=f"b{randomizer.randrange(2)}", + staging=tuple( + (f"t{n}", randomizer.choice(paths)) for n in range(2) + ), + retiring_root_keys={f"k{randomizer.randrange(8)}"}, + ) + serial = commit.ProvisionalOwnershipIndex(model, Serial(), entries) + parallel = commit.ProvisionalOwnershipIndex(model, Parallel(), entries) + assert parallel.conflict(**arguments) == serial.conflict(**arguments) + finally: + session.close() + + +def test_frozen_phase_allows_only_prepared_comparisons(tmp_path, scope, monkeypatch): + first, second = tmp_path / "missing-first", tmp_path / "missing-second" + scope.facts(first) + scope.facts(second) + views = dict(scope._views) + with scope.comparisons() as reader: + with pytest.raises(commit.ObservationChanged): + scope.project(first) + with pytest.raises(commit.ObservationChanged): + scope.seal() + with pytest.raises( + commit.CommitUnavailable, match="not observed before freezing" + ): + reader.prepare_overlap(tmp_path / "never-observed", second) + prepared = reader.prepare_overlap(first, second) + assert reader.probe_session.compare([(0, prepared)] * 128) == [] + assert scope._views == views + assert reader.probe_session.metrics()["commit_probe_state"] == "closed" + with pytest.raises(commit.ObservationChanged): + reader.facts(first) + with pytest.raises(commit.ObservationChanged): + scope.facts(first) + scope.seal() + + +def test_unproved_retirement_preserves_bindings_until_cleanup_retries( + tmp_path, scope, monkeypatch +): + first, second = tmp_path / "first", tmp_path / "second" + scope.facts(first) + scope.facts(second) + with pytest.raises(commit.ProbeCleanupFailed, match="retirement is unproved"): + with scope.comparisons() as reader: + original = reader.probe_session.close + + def interrupted_before_retirement(): + raise KeyboardInterrupt("interrupted before the admission fence") + + monkeypatch.setattr( + reader.probe_session, "close", interrupted_before_retirement + ) + reader.probe_session.compare([(0, reader.prepare_overlap(first, second))]) + assert not reader.probe_session.native_retired + assert scope._state == "comparing" + assert not reader._closed and reader._views + assert scope.reader.handles_opened > scope.reader.handles_closed + with pytest.raises(commit.ProbeCleanupFailed, match="root handles cannot close"): + scope.close() + assert scope.reader.handles_opened > scope.reader.handles_closed + monkeypatch.setattr(reader.probe_session, "close", original) + scope.close() + assert reader.probe_session.native_retired + assert scope.reader.handles_opened == scope.reader.handles_closed + + +def test_impersonation_cannot_move_probes_to_a_different_context(tmp_path, scope): + from ctypes import wintypes as w + + scope.facts(tmp_path / "missing") + security = ctypes.WinDLL("advapi32", use_last_error=True) + impersonate = security.ImpersonateSelf + impersonate.argtypes = (ctypes.c_int,) + impersonate.restype = w.BOOL + revert = security.RevertToSelf + revert.argtypes = () + revert.restype = w.BOOL + if not impersonate(2): # SecurityImpersonation; only our own test-process token. + pytest.skip("self-impersonation is unavailable") + try: + with pytest.raises(commit.CapabilityUnavailable, match="impersonating caller"): + with scope.comparisons(): + pytest.fail("created workers for an impersonating caller") + assert scope._comparison_reader is None + finally: + assert revert() + # The rejection neither poisons the ordinary caller nor opens worker leases. + with scope.comparisons() as reader: + assert reader.probe_session.metrics()["commit_probe_threads"] == 0 + scope.seal() + + +@pytest.mark.parametrize("reply", ["failure", "emulated", "unknown-native"]) +def test_uncertain_process_context_rejects_workers(scope, monkeypatch, reply): + from ctypes import wintypes as w + + def machine(process, emulated, native): + ctypes.cast(emulated, ctypes.POINTER(w.WORD)).contents.value = ( + 0x14C if reply == "emulated" else 0 + ) + ctypes.cast(native, ctypes.POINTER(w.WORD)).contents.value = ( + 0 if reply == "unknown-native" else 0x8664 + ) + return reply != "failure" + + monkeypatch.setattr(scope.reader._kernel, "IsWow64Process2", machine) + with pytest.raises( + commit.CapabilityUnavailable, match="emulated filesystem context" + ): + with scope.comparisons(): + pytest.fail("started a worker in an unqualified process context") + assert scope._comparison_reader is None + + +@pytest.mark.parametrize("replacement", ["file", "dangling-junction"]) +def test_reverse_probe_still_detects_mutation_in_parallel( + tmp_path, scope, monkeypatch, replacement +): + first, second = tmp_path / "missing-first", tmp_path / "missing-second" + scope.facts(first) + scope.facts(second) + request = scope._views[str(first)].probe + original = scope._probe_absence + owner = threading.get_ident() + changed = threading.Event() + + def mutate_after_forward(observed): + original(observed) + if ( + observed is request + and threading.get_ident() != owner + and not changed.is_set() + ): + changed.set() + if replacement == "file": + first.touch() + else: + target = tmp_path / "junction-target" + target.mkdir() + helpers._directory_link(first, target) + target.rmdir() + + monkeypatch.setattr(scope, "_probe_absence", mutate_after_forward) + with pytest.raises(commit.ObservationChanged): + with scope.comparisons() as reader: + reader.probe_session.compare([(0, reader.prepare_overlap(first, second))]) + assert changed.is_set() + metrics = scope.metrics() + assert metrics["commit_probe_state"] == "closed" + assert metrics["commit_probe_active"] == metrics["commit_probe_pending"] == 0 + + +@pytest.mark.parametrize("cleanup_failure", [False, True]) +def test_worker_failure_fallback_and_fatal_cleanup_preserve_claims( + tmp_path, monkeypatch, cleanup_failure +): + if os.name != "nt": + pytest.skip("native coordinator qualification requires Windows") + plan = helpers._write_plan( + tmp_path / "current.plan", + tmp_path / "generated", + tmp_path / "build", + ((helpers._target("parallel"), "sample.protocyte.hpp"),), + ) + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="reference" + ) + token = engine.reconcile(plan) + state = engine._state_directory(plan.root) + claim = (state / "claim.json").read_bytes() + engine.registry_validation = "indexed" + if cleanup_failure: + original = commit.concurrent.futures.ThreadPoolExecutor.shutdown + + def failed_shutdown(self, *args, **kwargs): + original(self, *args, **kwargs) + raise RuntimeError("injected executor retirement failure") + + monkeypatch.setattr( + commit.concurrent.futures.ThreadPoolExecutor, "shutdown", failed_shutdown + ) + monkeypatch.setattr( + engine, + "_validate_registry_reference", + lambda *a, **k: pytest.fail("unsafe cleanup used reference authority"), + ) + with pytest.raises( + coordinator.CoordinatorError, match="could not be retired safely" + ): + engine.reconcile(plan) + else: + + def failed_comparison(self, prepared): + raise RuntimeError("injected native worker failure") + + monkeypatch.setattr(commit._FrozenComparisons, "_compare", failed_comparison) + assert engine.reconcile(plan) == token + assert engine.validation_metrics["fallback"] == "reference" + assert engine.validation_metrics["reference_result"] == "accepted" + assert (state / "claim.json").read_bytes() == claim + metrics = engine.validation_metrics + assert metrics["commit_probe_active"] == metrics["commit_probe_pending"] == 0 + assert metrics["commit_handles_opened"] == metrics["commit_handles_closed"] + + +def test_previous_helper_during_upgrade_uses_reference_without_token_rotation( + tmp_path, monkeypatch +): + from types import ModuleType + + source = tmp_path / "previous-observation-helper.py" + repo = Path(__file__).resolve().parents[1] + source.write_bytes( + subprocess.check_output( + ["git", "show", "8851bde:cmake/ProtocyteObservationCommit.py"], cwd=repo + ) + ) + previous = ModuleType("previous_observation_helper") + sys.modules[previous.__name__] = previous + exec(compile(source.read_bytes(), str(source), "exec"), previous.__dict__) + assert not hasattr(previous, "ProbeCleanupFailed") + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="reference" + ) + plan = helpers._write_plan( + tmp_path / "plan", + tmp_path / "generated", + tmp_path / "build", + ((helpers._target("mixed-helper"), "sample.protocyte.hpp"),), + ) + token = engine.reconcile(plan) + state = engine._state_directory(plan.root) + claim = (state / "claim.json").read_bytes() + monkeypatch.setattr(coordinator, "_observation_commit_module", previous) + monkeypatch.setattr(coordinator, "_load_observation_commit", lambda: previous) + engine.registry_validation = "indexed" + assert engine.reconcile(plan) == token + assert engine.validation_metrics["fallback"] == "reference" + assert engine.validation_metrics["reference_result"] == "accepted" + assert (state / "claim.json").read_bytes() == claim diff --git a/tests/verify_consumer_registry.py b/tests/verify_consumer_registry.py index bca57ff..e62c0a9 100644 --- a/tests/verify_consumer_registry.py +++ b/tests/verify_consumer_registry.py @@ -268,11 +268,25 @@ def namespace_listing(path): } -def candidate(module, manifest: dict, work: Path, *, integrated: bool = False) -> dict: +def candidate( + module, + manifest: dict, + work: Path, + *, + integrated: bool = False, + default_mode: bool = False, +) -> dict: engine = module.OutputCoordinator( Path(manifest["registry"]), - registry_validation="indexed" if integrated else "reference", + **( + {} + if default_mode + else {"registry_validation": "indexed" if integrated else "reference"} + ), ) + if default_mode: + assert module._COMMITTED_INDEX_QUALIFIED is True + assert engine.registry_validation == "indexed" if integrated: # A failed timing gate must not hold the live shared lock for a slow # reference pass. The full reference oracles are qualified separately; @@ -316,6 +330,12 @@ def unexpected_reference(*args, **kwargs): assert metrics["commit_certificate"] == "verified" assert metrics["commit_state"] == "closed" assert metrics["commit_handles_opened"] == metrics["commit_handles_closed"] + assert metrics["commit_probe_state"] == "closed" + assert metrics["commit_probe_native_retired"] is True + assert metrics["commit_probe_active"] == metrics["commit_probe_pending"] == 0 + assert metrics["commit_probe_comparisons"] == metrics["commit_fresh_comparisons"] + assert metrics["commit_probe_peak_active"] <= metrics["commit_probe_workers"] <= 4 + assert metrics["commit_probe_peak_pending"] <= 2 * metrics["commit_probe_workers"] if integrated: assert metrics["authoritative"] == "index" assert metrics["reference_wall_seconds"] == 0 @@ -364,6 +384,7 @@ def main() -> None: "capture", "candidate", "indexed", + "default", "audit", "reference", "legacy-reference", @@ -390,11 +411,16 @@ def main() -> None: name: digest(source.with_name(name).read_bytes()) for name in IMPLEMENTATION } module = load(source, "qualified_consumer_" + args.mode.replace("-", "_")) + production_qualified = getattr(module, "_COMMITTED_INDEX_QUALIFIED", False) if args.mode == "capture": result = capture(module, manifest, args.work) - elif args.mode in ("candidate", "indexed"): + elif args.mode in ("candidate", "indexed", "default"): result = candidate( - module, manifest, args.work, integrated=args.mode == "indexed" + module, + manifest, + args.work, + integrated=args.mode != "candidate", + default_mode=args.mode == "default", ) elif args.mode == "audit": result = audit(module, manifest, args.work) @@ -411,7 +437,7 @@ def main() -> None: "python": platform.python_version(), "implementation_files": fingerprints, "qualification_driver_sha256": driver_fingerprint, - "index_authorization_enabled": False, + "index_authorization_enabled": production_qualified, **result, } (args.work / f"{args.mode}-{time.time_ns()}-results.json").write_text( diff --git a/tests/verify_coordinator_upgrade.py b/tests/verify_coordinator_upgrade.py index 8450451..00e0902 100644 --- a/tests/verify_coordinator_upgrade.py +++ b/tests/verify_coordinator_upgrade.py @@ -76,7 +76,7 @@ def load(name: str, script: Path): old = load("review_legacy", LEGACY) new = load("review_current", CURRENT) - assert new._COMMITTED_INDEX_QUALIFIED is False + production_qualified = new._COMMITTED_INDEX_QUALIFIED # Only isolated fixture registries below can exercise provisional authority. new._COMMITTED_INDEX_QUALIFIED = True assert old.PROTOCOL_VERSION == new.PROTOCOL_VERSION == 1 @@ -135,8 +135,10 @@ def functions(source: bytes): def engine(version: str, locks: Path): if version == "old": return old.OutputCoordinator(locks) - result = new.OutputCoordinator(locks, registry_validation=version) - if version == "indexed": + result = new.OutputCoordinator( + locks, **({} if version == "default" else {"registry_validation": version}) + ) + if version in ("indexed", "default"): validate = result._validate_registry def recorded(*args, **kwargs): @@ -211,8 +213,12 @@ def run(version: str, command: str, locks: Path, plan: Path, extras=(), crash=No args.append("--experimental-native-observation") elif version == "commit-shadow": args.append("--experimental-observation-commit") - elif version == "indexed": - args.append("--experimental-committed-index") + elif version == "reference": + args.append("--reference-registry-validation") + if version in ("indexed", "default"): + if version == "indexed": + args.append("--experimental-committed-index") + if version in ("indexed", "default") and not production_qualified: qualified_main = ( "import importlib.util,sys; " "spec=importlib.util.spec_from_file_location('qualified_upgrade_cli',sys.argv[1]); " @@ -250,6 +256,8 @@ def run(version: str, command: str, locks: Path, plan: Path, extras=(), crash=No ("commit-shadow", "old"), ("old", "indexed"), ("indexed", "old"), + ("old", "default"), + ("default", "old"), ) for writer, reader in transitions: root, locks, plan, target, staging = fixture(f"steady-{writer}-{reader}") @@ -300,6 +308,8 @@ def run(version: str, command: str, locks: Path, plan: Path, extras=(), crash=No ("commit-shadow", "old"), ("old", "indexed"), ("indexed", "old"), + ("old", "default"), + ("default", "old"), ): for phase in ( "after-pending", @@ -408,8 +418,8 @@ def run(version: str, command: str, locks: Path, plan: Path, extras=(), crash=No "reference_validator_ast_unchanged_since_checkpoint": reference_unchanged, "file_lock_ast_unchanged_since_checkpoint": True, "passed_cases": len(results), - "production_index_authorization_qualified": False, - "index_authority_enabled_only_in_isolated_fixture_module": True, + "production_index_authorization_qualified": production_qualified, + "index_authority_enabled_only_in_isolated_fixture_module": not production_qualified, "indexed_validations": len(indexed_validations), "index_authorized_validations": sum( metrics["authoritative"] == "index" for metrics in indexed_validations From 709b35537d61c7d276de7b7a20b13731af8e7e7c Mon Sep 17 00:00:00 2001 From: Anthony Printup <92564080+anthonyprintup@users.noreply.github.com> Date: Mon, 16 Nov 2026 20:50:03 +0100 Subject: [PATCH 09/12] test(coordinator): preserve cross-platform rejection and upgrade coverage Accept the existing POSIX ENOTDIR diagnostic when ancestor replacement is rejected before explicit parent inspection. Keep the required CoordinatorError and ownership rejection rather than changing the runtime path handling. Fetch repository history in plugin CI so the pinned previous-helper test runs against its actual implementation instead of failing in a shallow checkout. Document both initial CI failures and preserve every production source hash and the completed twenty-run qualification evidence. Validation: Ruff for src/tests; three ancestor-replacement/older-helper cases in reference mode; both ancestor-replacement cases in explicit indexed mode. Production implementation bytes are unchanged from the qualified source. --- .github/workflows/plugin.yml | 2 ++ docs/parallel-probe-results.json | 12 ++++++++++++ docs/parallel-probe-results.md | 7 +++++++ tests/test_output_coordinator.py | 5 ++++- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugin.yml b/.github/workflows/plugin.yml index ecf9a42..e6273b8 100644 --- a/.github/workflows/plugin.yml +++ b/.github/workflows/plugin.yml @@ -31,6 +31,8 @@ jobs: - name: Check out repository uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: + # Cross-version helper tests load the pinned historical implementation. + fetch-depth: 0 ref: ${{ inputs.checkout_ref || github.sha }} - name: Set up Python diff --git a/docs/parallel-probe-results.json b/docs/parallel-probe-results.json index e15721f..e1bdd34 100644 --- a/docs/parallel-probe-results.json +++ b/docs/parallel-probe-results.json @@ -1858,6 +1858,18 @@ "controlled_algorithm_only_comparison": false }, "verification": { + "ci_test_portability_followup": { + "initial_head": "99c2a693731419a002ce5dc6f5b9a28a41526ba9", + "initial_failures": [ + "POSIX ENOTDIR rejection used an already fail-closed diagnostic outside the test regex", + "shallow CI checkout lacked the pinned historical helper revision" + ], + "fixes": [ + "accept the existing POSIX rejection diagnostic in the ancestor-replacement test", + "fetch history in plugin CI to run the real pinned-helper compatibility test" + ], + "production_implementation_bytes_changed": false + }, "final_source_passes": [ { "check": "Ruff: all touched Python source and tests", diff --git a/docs/parallel-probe-results.md b/docs/parallel-probe-results.md index ae0bdc0..13deebb 100644 --- a/docs/parallel-probe-results.md +++ b/docs/parallel-probe-results.md @@ -141,6 +141,13 @@ unproved; incomplete certificates; previous-helper fallback; and token preservation. Existing native ABA, alias, metadata, malformed-record, concurrency, crash-cut and packaging checks remain in the full qualification. +The first Linux CI pass identified two test portability assumptions: POSIX may +reject a replaced ancestor with `ENOTDIR` before the explicit parent-type check, +and shallow checkouts lack the pinned older-helper revision. The rejection test +now accepts that existing fail-closed diagnostic, and plugin CI fetches history +to execute the actual historical compatibility test. Production implementation +bytes and all timing/source fingerprints are unchanged by these test fixes. + Quiet native test cases and default-enabled CLI/integration cases share a test-only mutex so their own USN markers do not invalidate each other on common volume ancestors. Deliberate threads/processes inside each case remain diff --git a/tests/test_output_coordinator.py b/tests/test_output_coordinator.py index b10f69c..bb3ff56 100644 --- a/tests/test_output_coordinator.py +++ b/tests/test_output_coordinator.py @@ -1895,7 +1895,10 @@ def project(path: Path, **options: object) -> Path: monkeypatch.setattr(coordinator, "project_path", project) with pytest.raises( - coordinator.CoordinatorError, match="symbolic link or junction|non-directory" + coordinator.CoordinatorError, + # POSIX can reject the child with ENOTDIR before reaching its replaced + # ancestor; Windows can report the child missing and inspect the parent. + match="symbolic link or junction|non-directory|could not identify physical filesystem location", ): coordinator._paths_overlap(parent, child) From 1d1e1b030c2d4738c7778a22f1f5fc8effa24b3a Mon Sep 17 00:00:00 2001 From: Anthony Printup <92564080+anthonyprintup@users.noreply.github.com> Date: Mon, 16 Nov 2026 21:00:57 +0100 Subject: [PATCH 10/12] test(coordinator): keep CMake-only qualification parallel Apply the quiet-observer test gate to integration cases only when the selected run also contains quiet native observers. Retain serialization for mixed runs and native cases while avoiding an unnecessary lock across every CMake-only test. Production locking, native probes, and all measured source bytes remain unchanged. Verify selection after marker deselection for native-only, CMake-only, and mixed invocations. Record the mixed native/CMake pass (168 passed, 1 skipped) and four-worker CMake-only pass (22 passed, 1 skipped in 35.91 seconds). --- docs/parallel-probe-results.json | 21 +++++++++++++++++-- docs/parallel-probe-results.md | 11 ++++++---- tests/conftest.py | 35 +++++++++++++++++++++++--------- 3 files changed, 51 insertions(+), 16 deletions(-) diff --git a/docs/parallel-probe-results.json b/docs/parallel-probe-results.json index e1bdd34..061a245 100644 --- a/docs/parallel-probe-results.json +++ b/docs/parallel-probe-results.json @@ -1868,7 +1868,24 @@ "accept the existing POSIX rejection diagnostic in the ancestor-replacement test", "fetch history in plugin CI to run the real pinned-helper compatibility test" ], - "production_implementation_bytes_changed": false + "production_implementation_bytes_changed": false, + "cmake_only_test_parallelism": "quiet-observer test gate applies to integration cases only when quiet native cases are selected", + "selection_checks": { + "quiet_native_only": true, + "cmake_only": false, + "mixed_native_and_cmake": true + }, + "mixed_native_cmake_run": { + "passed": 168, + "skipped": 1, + "seconds": 100.49 + }, + "cmake_only_parallel_run": { + "pytest_workers": 4, + "passed": 22, + "skipped": 1, + "seconds": 35.91 + } }, "final_source_passes": [ { @@ -2707,7 +2724,7 @@ }, "parallel_probe_tests": 64, "randomized_serial_parallel_differential_cases": 1024, - "test_case_serialization": "quiet native tests and CLI/integration cases share a test-only mutex; intentional concurrency inside cases is preserved", + "test_case_serialization": "when quiet native cases are selected, native and CLI/integration cases share a test-only mutex; CMake-only runs retain process parallelism and intentional concurrency inside every case is preserved", "cpp_files_touched": 0 }, "limits": [ diff --git a/docs/parallel-probe-results.md b/docs/parallel-probe-results.md index 13deebb..fc00292 100644 --- a/docs/parallel-probe-results.md +++ b/docs/parallel-probe-results.md @@ -131,6 +131,8 @@ boundaries, fresh-negative semantics, and cooperative-writer assumptions. | CMake packaging and integration | 22 passed, 1 skipped | | Old/new upgrade, rollback, publication, crash recovery | 111 passed | | Ruff on touched Python files | Passed | +| Mixed native/CMake run after narrowing the test gate | 168 passed, 1 skipped | +| CMake-only run with four pytest workers | 22 passed, 1 skipped; 35.91 seconds | The parallel suite contains 64 tests, including 1,024 randomized serial/parallel ownership and retirement comparisons; all batch boundaries; real simultaneous @@ -148,10 +150,11 @@ now accepts that existing fail-closed diagnostic, and plugin CI fetches history to execute the actual historical compatibility test. Production implementation bytes and all timing/source fingerprints are unchanged by these test fixes. -Quiet native test cases and default-enabled CLI/integration cases share a -test-only mutex so their own USN markers do not invalidate each other on -common volume ancestors. Deliberate threads/processes inside each case remain -concurrent. This does not replace or alter production ownership locks. One +When a run includes quiet native cases, those cases and default-enabled +CLI/integration cases share a test-only mutex so their own USN markers do not +invalidate each other on common volume ancestors. CMake-only runs keep their +ordinary process parallelism. Deliberate threads/processes inside each case +remain concurrent. This does not replace or alter production ownership locks. One test-harness race in the injected-wait handshake was corrected to wait for the actual injected interruption before releasing the blocked worker. diff --git a/tests/conftest.py b/tests/conftest.py index 88786b7..563b475 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -11,6 +11,26 @@ _lock_module = None +_quiet_observer_files = { + "test_output_coordinator.py", + "test_ownership_index.py", + "test_observation_commit.py", + "test_parallel_probes.py", + "test_path_observation.py", + "test_consumer_registry_qualification.py", +} +_has_quiet_observers = True + + +@pytest.hookimpl(trylast=True) +def pytest_collection_modifyitems(items): + # Marker deselection has finished. CMake-only CI does not run quiet native + # scopes and may keep its ordinary process parallelism. Mixed invocations + # still coordinate every CLI/integration case with those native scopes. + global _has_quiet_observers + _has_quiet_observers = any( + item.path.name in _quiet_observer_files for item in items + ) @pytest.fixture(autouse=True) @@ -18,17 +38,12 @@ def quiet_registry_observers(request: pytest.FixtureRequest): # Quiet certificate tests and default-enabled CLI subprocesses share volume # ancestors. Serialize *test cases*, while preserving each case's deliberate # worker/process concurrency. This does not alter production lock selection. - files = { - "test_output_coordinator.py", - "test_ownership_index.py", - "test_observation_commit.py", - "test_parallel_probes.py", - "test_path_observation.py", - "test_consumer_registry_qualification.py", - } if ( - request.node.path.name not in files - and request.node.get_closest_marker("cmake_integration") is None + request.node.path.name not in _quiet_observer_files + and ( + not _has_quiet_observers + or request.node.get_closest_marker("cmake_integration") is None + ) ): yield return From 9a109a2effcc0cad7eb9ac48985cff3e33305804 Mon Sep 17 00:00:00 2001 From: Anthony Printup <92564080+anthonyprintup@users.noreply.github.com> Date: Mon, 16 Nov 2026 22:48:46 +0100 Subject: [PATCH 11/12] fix(coordinator): close review safety gaps and gate index promotion Require typed EOF helper contracts in callers and helper entry points so a valid-but-truncated or mixed installation cannot skip staging comparisons. Protect older coordinators through the same helper entry checks without changing protocol-v1 records, tokens, lock identities, publication or recovery. Retire admitted native work even if admission/completion bookkeeping fails, and recheck the drain fence if a final worker notification is lost. Close unpublished handles after interrupted opens. Treat uncertain native releases and final accounting failures as fatal before fallback authorization; never retry a numeric handle whose OS close may already have completed. Keep routine tests independent of experimental git history and move actual pinned old/helper/coordinator interoperability checks into the explicit 115-case upgrade qualifier. Add fault, partial-source, backward-caller and cleanup regression coverage, including a non-mutating reproduction of the pre-review truncated-helper false acceptance. Close production index promotion after repeat complete validation reached 30.115 seconds on the fifth loaded sample. Preserve all samples and source fingerprints; single old/new controls do not replace the failed timing gate. Record both complete reference acceptances and unchanged-ledger/output audits. Validation: 1983 full tests; 89 explicit indexed tests; 257 minimum-Python native/index tests; 22 CMake integration tests; 115 upgrade/recovery cases; Ruff; AST/source preservation and privacy checks. No consumer migration, cache reset, token rotation or new configuration is required. --- .github/workflows/plugin.yml | 2 - cmake/ProtocyteObservationCommit.py | 90 +- cmake/ProtocyteOutputCoordinator.py | 22 +- cmake/ProtocyteOwnershipIndex.py | 7 + cmake/ProtocytePathObservation.py | 27 +- docs/consumer-validation-results.md | 3 +- docs/experimental-index-contract.md | 6 +- docs/mr55-review-results.json | 1632 +++++++++++++++++ docs/mr55-review-results.md | 154 ++ docs/observation-commit-contract.md | 51 +- docs/observation-commit-results.md | 3 +- docs/parallel-probe-results.md | 6 + docs/wiki/Contributing.md | 18 +- docs/wiki/Troubleshooting.md | 11 +- tests/test_consumer_registry_qualification.py | 1 + tests/test_observation_commit.py | 1 + tests/test_parallel_probes.py | 452 ++++- tests/verify_consumer_registry.py | 1 + tests/verify_coordinator_upgrade.py | 118 ++ 19 files changed, 2528 insertions(+), 77 deletions(-) create mode 100644 docs/mr55-review-results.json create mode 100644 docs/mr55-review-results.md diff --git a/.github/workflows/plugin.yml b/.github/workflows/plugin.yml index e6273b8..ecf9a42 100644 --- a/.github/workflows/plugin.yml +++ b/.github/workflows/plugin.yml @@ -31,8 +31,6 @@ jobs: - name: Check out repository uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: - # Cross-version helper tests load the pinned historical implementation. - fetch-depth: 0 ref: ${{ inputs.checkout_ref || github.sha }} - name: Set up Python diff --git a/cmake/ProtocyteObservationCommit.py b/cmake/ProtocyteObservationCommit.py index 56dcf3f..a943b4e 100644 --- a/cmake/ProtocyteObservationCommit.py +++ b/cmake/ProtocyteObservationCommit.py @@ -36,7 +36,7 @@ class ObservationChanged(RuntimeError): class ProbeCleanupFailed(RuntimeError): - """Worker retirement failed: reference fallback must not authorize mutation.""" + """Native work or handle cleanup failed; fallback must not authorize mutation.""" class ProbeSession: @@ -70,27 +70,34 @@ def __init__(self, compare, *, workers: int = 4) -> None: ) def _run(self, batch): - with self._condition: - if not self._accepting: - raise ObservationChanged("probe work admitted after retirement") - self._active += 1 - self._peak = max(self._peak, self._active) - self._started += 1 - self._threads.add(threading.get_ident()) + admitted = False completed = 0 result = [] try: + with self._condition: + if not self._accepting: + raise ObservationChanged("probe work admitted after retirement") + self._active += 1 + admitted = True + # Bookkeeping can allocate and raise. It belongs inside the + # same retirement finally as the native comparison itself. + self._peak = max(self._peak, self._active) + self._started += 1 + self._threads.add(threading.get_ident()) for reservation, prepared in batch: if self._compare(prepared): result.append(reservation) completed += 1 return result finally: - with self._condition: - self._comparisons += completed - self._completed += 1 - self._active -= 1 - self._condition.notify_all() + if admitted: + with self._condition: + # Retire first: even a later accounting failure cannot + # leave close() waiting for a batch that already exited. + self._active -= 1 + self._condition.notify_all() + self._comparisons += completed + self._completed += 1 def compare(self, prepared): self._require_owner() @@ -146,7 +153,9 @@ def close(self) -> None: if not self._active: self._native_retired = True break - self._condition.wait() + # A worker may fail while notifying its retirement. + # Recheck the fence even if that notification is lost. + self._condition.wait(timeout=0.1) except BaseException as error: if self._close_error is None: self._close_error = error @@ -359,6 +368,15 @@ class WindowsObservationCommit: MAX_RECORD_BYTES = 16 * 1024 * 1024 def __init__(self, native: Any, model: Any) -> None: + # Keep old coordinators safe too: they predate the caller-side version + # checks and can import an in-progress or mixed helper installation. + contracts = ( + (globals().get("COMMIT_CONTRACT_VERSION"), 2), + (getattr(native, "PATH_CONTRACT_VERSION", None), 1), + (getattr(model, "OWNERSHIP_CONTRACT_VERSION", None), 1), + ) + if any(type(value) is not int or value != expected for value, expected in contracts): + raise CapabilityUnavailable("incomplete observation helper installation") if os.name != "nt": raise CapabilityUnavailable("commit observations require Windows") self.native, self.model = native, model @@ -376,6 +394,7 @@ def __init__(self, native: Any, model: Any) -> None: self._inventories: list[ tuple[_Guard, tuple[str, ...], frozenset[str] | None] ] = [] + self._cleanup_error: BaseException | None = None self._counts = { name: 0 for name in ( @@ -608,8 +627,17 @@ def _identity(self, handle: Any) -> tuple[int, int]: return key def _release(self, handle: Any) -> None: - if not self.reader._close(handle): - raise CommitUnavailable("native handle release failed") + try: + closed = self.reader._close(handle) + except BaseException as error: + self._cleanup_error = error + if isinstance(error, Exception): + raise ProbeCleanupFailed("native handle release failed") from error + raise + if not closed: + error = ProbeCleanupFailed("native handle release failed") + self._cleanup_error = error + raise error self.reader.handles_closed += 1 def _adopt( @@ -718,8 +746,8 @@ def _request(self, parent: _View, component: str): def _open_child(self, request: Any): self._counts["commit_open_calls"] += 1 handle, status = self.w.HANDLE(), self.reader._status() - result = self.reader._open( - ctypes.byref(handle), + result = self.reader._invoke_open( + handle, 0x100081, ctypes.byref(request[2]), ctypes.byref(status), @@ -1163,12 +1191,13 @@ def certify(guard: _Guard, handle: Any) -> None: def close(self) -> None: self._require_owner() - error = None + error = self._cleanup_error if self._comparison_reader is not None: try: self._comparison_reader.close() except BaseException as failure: - error = failure + if error is None: + error = failure if not self._comparison_reader.probe_session.native_retired: raise ProbeCleanupFailed( "root handles cannot close before native probe retirement" @@ -1177,8 +1206,11 @@ def close(self) -> None: for guard in reversed(tuple(self._objects.values())): if guard.handle is None: continue + # Never retry an uncertain close: the OS may already have consumed + # the value and reused it for an unrelated process/thread handle. + handle, guard.handle = guard.handle, None try: - self._release(guard.handle) + self._release(handle) except BaseException as failure: if error is None: error = failure @@ -1188,8 +1220,16 @@ def close(self) -> None: self._bindings.clear() self._inventories.clear() self._volumes.clear() - self.reader.close() + try: + self.reader.close() + except BaseException as failure: + if error is None: + error = failure if error is not None: + self._state = "failed" + self._cleanup_error = error + if isinstance(error, Exception) and not isinstance(error, ProbeCleanupFailed): + raise ProbeCleanupFailed("native observation cleanup failed") from error raise error def metrics(self) -> dict[str, Any]: @@ -1204,6 +1244,7 @@ def metrics(self) -> dict[str, Any]: "commit_info_calls": self._counts["commit_info_calls"] + self.reader.information_calls, "commit_state": self._state, + "commit_cleanup_failed": self._cleanup_error is not None, "commit_handles_opened": self.reader.handles_opened, "commit_handles_closed": self.reader.handles_closed, "commit_final_path_calls": self.reader.final_path_calls, @@ -1283,3 +1324,8 @@ def conflict( continue return "staging-staging" return None + + +# Publish only after the complete helper has loaded. A syntactically valid +# truncated install must not advertise its contract. This is not a disk format. +COMMIT_CONTRACT_VERSION = 2 diff --git a/cmake/ProtocyteOutputCoordinator.py b/cmake/ProtocyteOutputCoordinator.py index 8f04d0c..750a2f3 100644 --- a/cmake/ProtocyteOutputCoordinator.py +++ b/cmake/ProtocyteOutputCoordinator.py @@ -36,10 +36,9 @@ PROTOCOL_VERSION = 1 -# Qualified on the complete retained consumer workload, including concurrent -# reference-reader load. Runtime capability, complete worker retirement, and -# exact native witnesses remain mandatory; every unverified case uses reference. -_COMMITTED_INDEX_QUALIFIED = True +# Review fixes are awaiting repeat qualification. Only isolated or +# mutation-forbidden qualification modules can exercise provisional authority. +_COMMITTED_INDEX_QUALIFIED = False PLAN_HEADER = "protocyte-output-plan-v1" GENERATED_SUFFIXES = (".protocyte.cpp", ".protocyte.hpp", "/runtime.hpp") @@ -1539,7 +1538,7 @@ def _validate_registry( module = _observation_commit_module cleanup_failure = getattr(module, "ProbeCleanupFailed", None) if cleanup_failure is not None and isinstance(error, cleanup_failure): - _fail("native probe workers could not be retired safely; no reconciliation changes were authorized") + _fail("native observation resources could not be retired safely; no reconciliation changes were authorized") # A failed or unsupported certificate grants no authority. The # ordinary reference path still determines this operation. metrics["preview_result"] = "unverified" @@ -1553,6 +1552,7 @@ def _validate_registry( preview_accepted is True and metrics.get("commit_certificate") == "verified" and metrics.get("commit_state") == "closed" + and metrics.get("commit_cleanup_failed") is False and metrics.get("commit_probe_state") == "closed" and metrics.get("commit_probe_native_retired") is True and type(metrics.get("commit_probe_active")) is int @@ -1674,7 +1674,17 @@ def _preview_committed_index( ) -> bool: model = _load_ownership_index() module = _load_observation_commit() - scope = module.WindowsObservationCommit(_load_path_observation(), model) + # A partially updated install must not dispatch work through an older + # helper lacking exception-safe admission and fatal handle cleanup. + contract = getattr(module, "COMMIT_CONTRACT_VERSION", None) + if type(contract) is not int or contract != 2: + raise RuntimeError("observation helper contract requires reference validation") + native = _load_path_observation() + for dependency, marker in ((model, "OWNERSHIP_CONTRACT_VERSION"), (native, "PATH_CONTRACT_VERSION")): + contract = getattr(dependency, marker, None) + if type(contract) is not int or contract != 1: + raise RuntimeError("observation dependency requires reference validation") + scope = module.WindowsObservationCommit(native, model) metrics = self.validation_metrics metrics.update(commit_claims_checked=0, commit_certificate="unverified") entries = [] diff --git a/cmake/ProtocyteOwnershipIndex.py b/cmake/ProtocyteOwnershipIndex.py index 836426f..c26b609 100644 --- a/cmake/ProtocyteOwnershipIndex.py +++ b/cmake/ProtocyteOwnershipIndex.py @@ -50,6 +50,9 @@ class OwnershipIndex: """ def __init__(self, reservations: Iterable[Reservation]) -> None: + contract = globals().get("OWNERSHIP_CONTRACT_VERSION") + if type(contract) is not int or contract != 1: + raise RuntimeError("incomplete ownership helper installation") self.reservations = tuple(reservations) self.queries = 0 exact: dict[LocationKey, set[int]] = {} @@ -120,3 +123,7 @@ def conflict( continue return "staging-staging" return None + + +# EOF capability marker; an incomplete installed source cannot advertise it. +OWNERSHIP_CONTRACT_VERSION = 1 diff --git a/cmake/ProtocytePathObservation.py b/cmake/ProtocytePathObservation.py index 6da3476..1aa9d40 100644 --- a/cmake/ProtocytePathObservation.py +++ b/cmake/ProtocytePathObservation.py @@ -25,6 +25,9 @@ class FreshPathObserver: """Own native call bindings, not observations, for one validation phase.""" def __init__(self) -> None: + contract = globals().get("PATH_CONTRACT_VERSION") + if type(contract) is not int or contract != 1: + raise ObservationUnavailable("incomplete path helper installation") if os.name != "nt": raise ObservationUnavailable("native path observation requires Windows") from ctypes import wintypes as w @@ -120,6 +123,22 @@ def _native_name(path: Path) -> str: raise ObservationUnavailable("path needs the portable reference reader") return "\\??\\" + text + def _invoke_open(self, handle, *arguments): + try: + return self._open(ctypes.byref(handle), *arguments) + except BaseException: + # A foreign call can raise after the OS wrote its output handle. + # It has not been published to any caller yet; retire it exactly + # once before propagating the error or permitting reference work. + if handle.value: + try: + self.handles_opened += 1 + finally: + if not self._close(handle): + raise UnsafeObservation("interrupted open could not release its handle") + self.handles_closed += 1 + raise + def _open_existing(self, path: Path): text = self._native_name(path) encoded_length = len(text.encode("utf-16-le")) @@ -142,8 +161,8 @@ def _open_existing(self, path: Path): status = self._status() handle = self._w.HANDLE() self.open_calls += 1 - result = self._open( - ctypes.byref(handle), + result = self._invoke_open( + handle, 0x100080, # SYNCHRONIZE | FILE_READ_ATTRIBUTES ctypes.byref(attributes), ctypes.byref(status), @@ -243,3 +262,7 @@ def metrics(self) -> dict[str, int]: "native_handles_opened": self.handles_opened, "native_handles_closed": self.handles_closed, } + + +# EOF capability marker; an incomplete installed source cannot advertise it. +PATH_CONTRACT_VERSION = 1 diff --git a/docs/consumer-validation-results.md b/docs/consumer-validation-results.md index b8418f2..074878e 100644 --- a/docs/consumer-validation-results.md +++ b/docs/consumer-validation-results.md @@ -3,7 +3,8 @@ Historical serial qualification at `8851bde`. Its failed timing gate and source fingerprints are preserved here. The subsequent [parallel-probe qualification](parallel-probe-results.md) passed the gate and -documents the current automatic default on the experimental branch. +documents the initial enablement. The subsequent [MR review](mr55-review-results.md) +closed promotion after a repeat timing failure and records the current default. This report uses an anonymous retained consumer configuration, not a synthetic replacement. Raw manifests, logs, claim tokens, ledger copies, paths, and output diff --git a/docs/experimental-index-contract.md b/docs/experimental-index-contract.md index bb43025..5d03d5b 100644 --- a/docs/experimental-index-contract.md +++ b/docs/experimental-index-contract.md @@ -1,9 +1,9 @@ # Experimental ownership-index contract -This records the first sampled-index experiment. For the current qualified -parallel observation mechanism and automatic Windows default, see the +This records the first sampled-index experiment. For the reviewed parallel +observation mechanism and closed promotion guard, see the [observation contract](observation-commit-contract.md) and -[parallel results](parallel-probe-results.md). +[MR review](mr55-review-results.md). Branch: `codex/experimental-generation-engine`, based on preservation checkpoint `f804fd1` (`codex/issue-54-registry-scaling`). No remote publication is involved. diff --git a/docs/mr55-review-results.json b/docs/mr55-review-results.json new file mode 100644 index 0000000..71c75aa --- /dev/null +++ b/docs/mr55-review-results.json @@ -0,0 +1,1632 @@ +{ + "date": "2026-11-16", + "reviewed_pull_request": 55, + "review_start_head": "1d1e1b030c2d4738c7778a22f1f5fc8effa24b3a", + "branch": "codex/experimental-generation-engine", + "decision": { + "merge_recommendation": "hold indexed promotion; keep MR draft", + "production_index_qualified": false, + "default_validation": "reference", + "consumer_cannot_enable_unqualified_index": true, + "required_validation_seconds": 30, + "reliable_timing_gate_passed": false + }, + "findings": [ + { + "priority": "P1", + "title": "Incomplete helpers could authorize overlapping staging", + "before": "A syntactically valid truncated pre-review helper accepted a root/staging conflict that fresh reference rejected.", + "fix": "Typed EOF capability markers and checks in both caller and helper entry points prevent incomplete or mixed helpers from gaining authority, including older callers.", + "status": "fixed", + "reproducer": { + "baseline_commit": "1d1e1b0", + "valid_truncated_helper_compiled": true, + "indexed_overlap_accepted": true, + "fresh_reference_overlap_rejected": true, + "current_claim_created": false, + "unsafe_reconciliation_executed": false + } + }, + { + "priority": "P2", + "title": "Worker bookkeeping and lost wakeups could strand retirement", + "before": "An admission bookkeeping MemoryError left active=1 with no native query running; a failed final notification could strand a draining owner.", + "fix": "Admission is inside the retirement finally; active work retires before optional accounting, and draining rechecks the fence with a bounded condition wait.", + "status": "fixed" + }, + { + "priority": "P2", + "title": "Native acquisition and release errors crossed the cleanup boundary", + "before": "An interrupted successful open lost an uncounted handle; failed close accounting could still permit reference authorization.", + "fix": "Unpublished output handles are retired on foreign-call exceptions; uncertain close completion is latched as fatal, never retried, and never permits fallback authorization.", + "status": "fixed", + "primary_source": "https://learn.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-closehandle" + }, + { + "priority": "P2", + "title": "Routine CI depended on experimental branch history", + "before": "Pinned git-show unit tests could fail after shallow checkout, squash merge or branch deletion.", + "fix": "Routine contract tests are self-contained; actual pinned old/helper/coordinator checks live in the explicit 115-case historical-source qualifier. CI no longer fetches all history for these unit tests.", + "status": "fixed" + } + ], + "final_implementation_files": { + "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", + "ProtocyteOwnershipIndex.py": "bb9b4f8f6325861706aa2ea5e270e013a862f53f3485d3d06dcc2e1cdfde5630", + "ProtocytePathObservation.py": "9edce3ad2770452bdbbe0f610bba71b9a5708f6fa67d638aab44c5763ae764f0", + "ProtocyteObservationCommit.py": "d6cf05762997718e535a16a8392e26f7794b53a547774c58fa5472c9591bbba9" + }, + "git_normalized_implementation_files": { + "ProtocyteOutputCoordinator.py": "f67a30883f713471ea661e8488903bef75108888bc5b247aa4f4dd0ba826814a", + "ProtocyteOwnershipIndex.py": "bb9b4f8f6325861706aa2ea5e270e013a862f53f3485d3d06dcc2e1cdfde5630", + "ProtocytePathObservation.py": "9edce3ad2770452bdbbe0f610bba71b9a5708f6fa67d638aab44c5763ae764f0", + "ProtocyteObservationCommit.py": "d6cf05762997718e535a16a8392e26f7794b53a547774c58fa5472c9591bbba9" + }, + "source_normalization": { + "difference": "CRLF to LF only", + "ast_identical": true + }, + "internal_helper_contracts": { + "commit": 2, + "ownership": 1, + "path": 1, + "published_at_eof": true + }, + "ownership_protocol_version": 1, + "wire_lock_reference_and_mutation_ast_unchanged_since_review_start": [ + "FileLock", + "Plan", + "_canonical_json", + "_path_key", + "_load_json", + "_validate_staging_path", + "OutputCoordinator._validate_registry_reference", + "OutputCoordinator._claim_paths", + "OutputCoordinator._load_recorded_plan", + "OutputCoordinator._validate_claim_shape", + "OutputCoordinator._require_plan_claim_binding", + "OutputCoordinator.reconcile_set", + "OutputCoordinator._reconcile_locked", + "OutputCoordinator.validate", + "OutputCoordinator.publish", + "OutputCoordinator.reset", + "OutputCoordinator._recover", + "OutputCoordinator._apply_pending", + "OutputCoordinator._publish_one", + "OutputCoordinator._initialize_claim_locked", + "OutputCoordinator._release_claim", + "OutputCoordinator._generation_lock", + "OutputCoordinator._publication_lock" + ], + "geometry_and_witness_ast_unchanged_since_review_start": [ + "WindowsObservationCommit._identity", + "WindowsObservationCommit._root", + "WindowsObservationCommit._view", + "WindowsObservationCommit._descriptor", + "WindowsObservationCommit._overlaps_views", + "WindowsObservationCommit.path_key", + "WindowsObservationCommit.contains", + "WindowsObservationCommit.physically_contains", + "WindowsObservationCommit.read_json", + "WindowsObservationCommit._collect_witnesses", + "WindowsObservationCommit.seal" + ], + "workload": { + "registry_entries": 2239, + "ledger_records": 4478, + "current_plans": 11, + "targets_per_plan": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "declared_outputs": 232, + "committed_output_files_checked": 232, + "claims_plans_snapshots_and_outputs_unchanged": true, + "snapshot_byte_identical": true, + "tokens_produced": 0, + "reconciliation_authorized": false, + "ntfs_volumes": 2, + "python": "3.12.9", + "same_ledger_as_initial_mr_qualification": true, + "original_live_registry_and_lock_namespace": true, + "cold_os_cache_claimed": false + }, + "repeat_timing_gate": { + "planned_samples": 10, + "executed_samples": 5, + "stopped_on_first_threshold_failure": true, + "complete_reference_readers_during_every_sample": 2, + "samples_under_30_seconds": 4, + "wall_samples_seconds": [ + 28.856071299989708, + 29.55085189989768, + 29.314126100041904, + 28.384457200067118, + 30.115117600071244 + ], + "median_seconds": 29.314126100041904, + "source_note": "Cleanup fixes measured before final constructor-only compatibility guards; the comparison/IO algorithm is unchanged. This failed gate is not replaced by later controls.", + "run_intervals": [ + { + "run": 1, + "started_unix_seconds": 1794863913.365, + "finished_unix_seconds": 1794863943.043, + "validation_seconds": 28.856071299989708 + }, + { + "run": 2, + "started_unix_seconds": 1794863943.084, + "finished_unix_seconds": 1794863973.393, + "validation_seconds": 29.55085189989768 + }, + { + "run": 3, + "started_unix_seconds": 1794863973.411, + "finished_unix_seconds": 1794864003.564, + "validation_seconds": 29.314126100041904 + }, + { + "run": 4, + "started_unix_seconds": 1794864003.582, + "finished_unix_seconds": 1794864032.65, + "validation_seconds": 28.384457200067118 + }, + { + "run": 5, + "started_unix_seconds": 1794864032.668, + "finished_unix_seconds": 1794864063.642, + "validation_seconds": 30.115117600071244 + } + ], + "runs": [ + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", + "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", + "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de", + "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7" + }, + "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 28.856071299989708, + "validation_cpu_seconds": 30.796875, + "plan_parse_seconds": 0.22461200004909188, + "lock_wait_seconds": 0.41957729996647686, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 27.200438000028953, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 720656, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_cleanup_failed": false, + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", + "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", + "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de", + "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7" + }, + "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 29.55085189989768, + "validation_cpu_seconds": 30.953125, + "plan_parse_seconds": 0.20746730000246316, + "lock_wait_seconds": 0.4216287999879569, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 27.834398100036196, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719856, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_cleanup_failed": false, + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", + "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", + "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de", + "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7" + }, + "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 29.314126100041904, + "validation_cpu_seconds": 29.703125, + "plan_parse_seconds": 0.17460689996369183, + "lock_wait_seconds": 0.37870399991516024, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 27.75422489992343, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 720896, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_cleanup_failed": false, + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", + "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", + "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de", + "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7" + }, + "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 28.384457200067118, + "validation_cpu_seconds": 30.265625, + "plan_parse_seconds": 0.18637050001416355, + "lock_wait_seconds": 0.34978070005308837, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 26.784217200009152, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 720096, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_cleanup_failed": false, + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + { + "mode": "indexed", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", + "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", + "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de", + "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7" + }, + "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", + "index_authorization_enabled": false, + "result": "accepted", + "validation_seconds": 30.115117600071244, + "validation_cpu_seconds": 30.6875, + "plan_parse_seconds": 0.22936410002876073, + "lock_wait_seconds": 0.47622479998972267, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 28.19692970009055, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 720416, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_cleanup_failed": false, + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + } + ] + }, + "final_source_control_comparison": { + "formal_promotion_gate": false, + "interpretation": "descriptive single old/new samples under one continuing reference reader; no controlled regression or reliability claim", + "runs": [ + { + "mode": "old", + "started_unix_seconds": 1794864447.1990912, + "finished_unix_seconds": 1794864477.6079519, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", + "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", + "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", + "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" + }, + "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", + "formal_gate_sample": false, + "result": "accepted", + "validation_seconds": 29.89271359995473, + "validation_cpu_seconds": 30.171875, + "plan_parse_seconds": 0.2687357999384403, + "lock_wait_seconds": 0.512010500067845, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 27.833131999941543, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 728416, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0, + "complete_reference_readers_during_sample": 1 + }, + { + "mode": "reviewed", + "started_unix_seconds": 1794864478.8702788, + "finished_unix_seconds": 1794864508.4931316, + "implementation_files": { + "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", + "ProtocyteOwnershipIndex.py": "bb9b4f8f6325861706aa2ea5e270e013a862f53f3485d3d06dcc2e1cdfde5630", + "ProtocytePathObservation.py": "9edce3ad2770452bdbbe0f610bba71b9a5708f6fa67d638aab44c5763ae764f0", + "ProtocyteObservationCommit.py": "d6cf05762997718e535a16a8392e26f7794b53a547774c58fa5472c9591bbba9" + }, + "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", + "formal_gate_sample": false, + "result": "accepted", + "validation_seconds": 29.135975199984387, + "validation_cpu_seconds": 29.5, + "plan_parse_seconds": 0.23981910001020879, + "lock_wait_seconds": 0.4828729999717325, + "current_plans": 11, + "registry_entries": 2239, + "original_live_registry_and_locks": true, + "native_metrics": { + "mode": "indexed", + "authoritative": "index", + "preview_wall_seconds": 26.958232400007546, + "reference_wall_seconds": 0.0, + "agreement": null, + "commit_claims_checked": 2239, + "commit_certificate": "verified", + "commit_reservations": 4486, + "commit_index_queries": 22, + "commit_fresh_comparisons": 84579, + "commit_open_calls": 30386, + "commit_info_calls": 58353, + "commit_negative_probes": 261703, + "commit_close_posts": 17958, + "commit_version_reads": 13457, + "commit_epoch_queries": 6, + "commit_journal_reads": 2, + "commit_journal_bytes": 719616, + "commit_witnesses": 8979, + "commit_records_read": 4478, + "commit_binding_checks": 12447, + "commit_record_read_calls": 8956, + "commit_record_seek_calls": 4478, + "commit_directory_enumerations": 8976, + "commit_full_inventory_scans": 2, + "commit_worker_context_checks": 2, + "commit_probe_state": "closed", + "commit_probe_workers": 4, + "commit_probe_native_retired": true, + "commit_probe_threads": 4, + "commit_probe_active": 0, + "commit_probe_peak_active": 4, + "commit_probe_pending": 0, + "commit_probe_peak_pending": 8, + "commit_probe_batches_submitted": 2662, + "commit_probe_batches_started": 2662, + "commit_probe_batches_finished": 2662, + "commit_probe_comparisons": 84579, + "commit_state": "closed", + "commit_cleanup_failed": false, + "commit_handles_opened": 26916, + "commit_handles_closed": 26916, + "commit_final_path_calls": 8979, + "preview_result": "accepted", + "reference_result": "not-required" + }, + "ownership_or_output_mutations": 0, + "tokens_produced": 0, + "complete_reference_readers_during_sample": 1 + } + ] + }, + "full_reference_oracles": [ + { + "mode": "legacy", + "implementation_files": { + "driver.py": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", + "legacy.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", + "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7", + "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", + "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", + "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de" + }, + "original_workload": true, + "frozen_sources": true, + "started_unix_seconds": 1794863478.6883984, + "finished_unix_seconds": 1794864731.773494, + "result": "accepted", + "registry_entries": 2239, + "claims_checked": 2239, + "validation_seconds": 1249.3908620000584, + "validation_cpu_seconds": 780.25, + "frozen_ledger": true, + "original_output_paths": true, + "original_namespace_checked_separately": true, + "live_shared_lock_held": false, + "ownership_or_output_mutations": 0 + }, + { + "mode": "reference", + "implementation_files": { + "driver.py": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", + "legacy.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", + "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7", + "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", + "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", + "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de" + }, + "original_workload": true, + "frozen_sources": true, + "started_unix_seconds": 1794863478.8033924, + "finished_unix_seconds": 1794864432.9595044, + "result": "accepted", + "registry_entries": 2239, + "claims_checked": 2239, + "validation_seconds": 948.4977354999864, + "validation_cpu_seconds": 572.734375, + "frozen_ledger": true, + "original_output_paths": true, + "original_namespace_checked_separately": true, + "live_shared_lock_held": false, + "ownership_or_output_mutations": 0 + } + ], + "oracle_source_provenance": { + "source_fingerprints": { + "driver.py": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", + "legacy.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", + "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7", + "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", + "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", + "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de" + }, + "final_reference_methods_ast_identical": true, + "native_helpers_unused_by_reference_oracles": true + }, + "preservation": { + "mode": "audit", + "platform": "Windows", + "python": "3.12.9", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", + "ProtocyteOwnershipIndex.py": "bb9b4f8f6325861706aa2ea5e270e013a862f53f3485d3d06dcc2e1cdfde5630", + "ProtocytePathObservation.py": "9edce3ad2770452bdbbe0f610bba71b9a5708f6fa67d638aab44c5763ae764f0", + "ProtocyteObservationCommit.py": "d6cf05762997718e535a16a8392e26f7794b53a547774c58fa5472c9591bbba9" + }, + "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", + "index_authorization_enabled": false, + "registry_entries": 2239, + "committed_output_files_checked": 232, + "claims_plans_snapshots_outputs_and_mtimes_unchanged": true, + "ownership_or_output_mutations": 0, + "tokens_produced": 0 + }, + "verification": { + "full_python314_suite": { + "passed": 1983, + "skipped": 41 + }, + "explicit_indexed_coordinator_suite": { + "passed": 89, + "skipped": 6 + }, + "minimum_python312_native_index_qualification": { + "passed": 257 + }, + "cmake_packaging_integration": { + "passed": 22, + "skipped": 1 + }, + "parallel_failure_and_upgrade_contract_tests": 120, + "cross_version_upgrade": { + "scope": "isolated Windows cross-version checks; no consumer registry accessed", + "legacy_git_blob": "25f1660190d3d1015fef3955814c8c737bd686c5", + "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", + "candidate_coordinator_sha256": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", + "implementation_files": { + "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", + "ProtocyteOwnershipIndex.py": "bb9b4f8f6325861706aa2ea5e270e013a862f53f3485d3d06dcc2e1cdfde5630", + "ProtocytePathObservation.py": "9edce3ad2770452bdbbe0f610bba71b9a5708f6fa67d638aab44c5763ae764f0", + "ProtocyteObservationCommit.py": "d6cf05762997718e535a16a8392e26f7794b53a547774c58fa5472c9591bbba9" + }, + "candidate_helper_sha256": { + "ProtocyteOwnershipIndex.py": "bb9b4f8f6325861706aa2ea5e270e013a862f53f3485d3d06dcc2e1cdfde5630", + "ProtocytePathObservation.py": "9edce3ad2770452bdbbe0f610bba71b9a5708f6fa67d638aab44c5763ae764f0", + "ProtocyteObservationCommit.py": "d6cf05762997718e535a16a8392e26f7794b53a547774c58fa5472c9591bbba9" + }, + "mixed_source_sha256": { + "helper-8851bde": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583", + "helper-1d1e1b0": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664", + "coordinator-1d1e1b0": "88fbf0a18beab9b55a6efad4c8136bdc023834de149f7bced1715a09420948ca" + }, + "unchanged_ast_methods_since_checkpoint": [ + "reconcile_set", + "_reconcile_locked", + "validate", + "publish", + "reset", + "_recover", + "_apply_pending", + "_publish_one", + "_initialize_claim_locked", + "_release_claim", + "_generation_lock", + "_publication_lock" + ], + "reference_validator_ast_unchanged_since_checkpoint": false, + "file_lock_ast_unchanged_since_checkpoint": true, + "passed_cases": 115, + "production_index_authorization_qualified": false, + "index_authority_enabled_only_in_isolated_fixture_module": true, + "indexed_validations": 32, + "index_authorized_validations": 30, + "indexed_reference_fallbacks": 2, + "cases": [ + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "reference", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "reference", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "shadow", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "native-shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "native-shadow", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "commit-shadow", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "commit-shadow", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "indexed", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "indexed", + "reader": "old", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "old", + "reader": "default", + "passed": true + }, + { + "kind": "upgrade-rollback-noop-token-and-publication", + "writer": "default", + "reader": "old", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "reference", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "native-shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "native-shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "commit-shadow", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "commit-shadow", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "indexed", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "indexed", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "old", + "reader": "default", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-pending", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-output-1", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-output-2", + "passed": true + }, + { + "kind": "publication-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-initial-snapshot", + "passed": true + }, + { + "kind": "initialization-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-claim", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-reset-intent", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-reset-output-1", + "passed": true + }, + { + "kind": "reset-crash-recovery", + "writer": "default", + "reader": "old", + "cut": "after-reset-disposable", + "passed": true + }, + { + "kind": "actual-previous-helper-reference-fallback", + "revision": "8851bde", + "passed": true + }, + { + "kind": "actual-previous-helper-reference-fallback", + "revision": "1d1e1b0", + "passed": true + }, + { + "kind": "actual-previous-coordinator-updated-helper", + "failed_cleanup": false, + "passed": true + }, + { + "kind": "actual-previous-coordinator-updated-helper", + "failed_cleanup": true, + "passed": true + } + ] + }, + "ruff": "passed", + "cpp_files_touched": 0 + }, + "limits": [ + "The repeat timing gate failed; the index remains gated even though all sampled index answers agreed with reference.", + "Native queries must retire before root handles can close; blocked native IO can delay cancellation.", + "An uncertain failed close aborts the operation. Numeric handles are not retried because the OS may already have reused the value.", + "The consistency boundary remains past positive intervals with fresh negatives, not an atomic namespace freeze or protection against noncooperative record writers.", + "Capability, alias, journal and ordinary observation failures require complete safe cleanup before reference fallback.", + "Timing evidence covers this retained workload on one Windows/NTFS host with reused OS caches; it is not a universal latency guarantee." + ], + "privacy": "anonymous consumer; no paths, names, tokens, ledger contents, raw manifests or raw logs are published" +} diff --git a/docs/mr55-review-results.md b/docs/mr55-review-results.md new file mode 100644 index 0000000..d5e98ca --- /dev/null +++ b/docs/mr55-review-results.md @@ -0,0 +1,154 @@ +# MR #55 correctness and upgrade review + +**Hold indexed promotion.** Four findings were fixed, including a reproduced +false acceptance through a valid-but-truncated helper. Correctness, failure +paths, packaging and **115 actual-source upgrade/recovery cases pass**. +The repeat timing gate failed at **30.115 seconds** on its fifth sample, so +**the index is disabled and the default is reference validation**. The MR +remains a draft. The prior [20-run qualification](parallel-probe-results.md) +is preserved as historical evidence, not a promotion override. + +## Findings and fixes + +### [P1] Incomplete helpers could authorize overlapping staging + +A syntactically valid truncated pre-review helper accepted a root/staging conflict that fresh reference rejected. + +Typed EOF capability markers and checks in both caller and helper entry points prevent incomplete or mixed helpers from gaining authority, including older callers. + +### [P2] Worker bookkeeping and lost wakeups could strand retirement + +An admission bookkeeping MemoryError left active=1 with no native query running; a failed final notification could strand a draining owner. + +Admission is inside the retirement finally; active work retires before optional accounting, and draining rechecks the fence with a bounded condition wait. + +### [P2] Native acquisition and release errors crossed the cleanup boundary + +An interrupted successful open lost an uncounted handle; failed close accounting could still permit reference authorization. + +Unpublished output handles are retired on foreign-call exceptions; uncertain close completion is latched as fatal, never retried, and never permits fallback authorization. + +### [P2] Routine CI depended on experimental branch history + +Pinned git-show unit tests could fail after shallow checkout, squash merge or branch deletion. + +Routine contract tests are self-contained; actual pinned old/helper/coordinator checks live in the explicit 115-case historical-source qualifier. CI no longer fetches all history for these unit tests. + +The incomplete-helper reproducer used the exact pre-review source, truncated +at a valid Python boundary before current staging comparisons. Its index +accepted a staging/root overlap that fresh reference validation rejected. +The unsafe plan was never reconciled and no current claim was created. +Caller checks alone would not protect an older coordinator, so helper +constructors also check their EOF markers before acquiring OS resources. + +The cleanup tests cover failures before and after OS close completion. A +failed/uncertain numeric handle is never automatically retried; known +remaining roots close once, cleanup stays failed, and no reconciliation is +authorized. [Microsoft documents single-close usage and invalid-handle behavior](https://learn.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-closehandle). +Tests explicitly release only the handles their injector knows it withheld +before any OS close; production cannot make that assumption. + +## Repeat workload gate + +The same original anonymous configuration still has **2,239 claims**, +**4,478 claim/plan records**, **11 current plans**, and **232 generated files** +on two NTFS volumes. Its captured ledger is byte-identical to the initial MR +qualification. No claims were pruned, split or reset. Each fresh process uses +CPython 3.12.9 and the original registry/generation/publication locks. + +| Run | Complete validation | Under 30 seconds | +| --- | ---: | :---: | +| 1 | 28.856071 s | Yes | +| 2 | 29.550852 s | Yes | +| 3 | 29.314126 s | Yes | +| 4 | 28.384457 s | Yes | +| 5 | 30.115118 s | **No** | + +The intended ten-sample series stopped on the first failure. Both complete +reference readers were active throughout every sample. All five index answers +were accepted with verified witnesses, 261,703 fresh negative probes, 84,579 +comparisons, 4,478 authenticated records, fully retired workers and all 26,916 +native handles closed. The gate measures current-plan parsing and the complete +validation, including observer-mutex wait; ownership-lock wait is separate. +The fifth sample includes plan parsing even though the progress phase timer +alone was just below 30 seconds. No timing component was removed to pass. + +These samples include the cleanup fixes before final constructor-only +compatibility guards. The final source keeps the same comparison/IO algorithm +and remains disabled. A separate final-source control accepted the full ledger +in **29.136 seconds**, compared with **29.893 seconds** for the prior native +implementation. Both control samples overlapped the continuing legacy +reference reader, after the branch reference reader had completed. They are +descriptive single samples, not proof of a code regression or a reliable +latency bound, and do not replace the failed promotion gate. + +The result calls for more headroom before promotion. A quieter sample, +rounding away plan parsing, or the previous successful series cannot reopen +the source gate. No production index enablement is included in this revision. + +## Reference acceptance and preservation + +- Exact historical coordinator: all **2,239 claims accepted**, **1249.391 seconds** under concurrent reader/test load. +- Branch reference validator: all **2,239 claims accepted**, **948.498 seconds** under concurrent reader/test load. + +Slow oracles use byte-identical frozen ledgers and the original build/output/ +staging geometry, with original lock-namespace checks performed separately. +They hold no long-lived live shared registry lock. Their reference methods +are AST-identical to the final implementation; frozen native helper files +are not used by reference validation. Timings are not controlled speedup ratios. + +The final preservation audit verified original claim/plan bytes, current +snapshots, and all **232 generated-file hashes and mtimes**. Live qualification +created no tokens and performed no reconciliation, publication, reset or +ownership/output mutation. USN observation still posts counted journal +metadata. Raw consumer evidence remains ignored and anonymous. + +## Final correctness and upgrade qualification + +| Check | Result | +| --- | --- | +| CPython 3.14.4 complete suite, four pytest workers | 1,983 passed, 41 skipped | +| Explicit indexed coordinator suite | 89 passed, 6 skipped | +| Minimum CPython 3.12.9 native/index qualification | 257 passed | +| CMake packaging/integration | 22 passed, 1 skipped | +| Pinned actual-source upgrade, rollback and crash recovery | 115 passed | +| Ruff, source/AST and whitespace checks | Passed | + +The parallel/failure suite now has **120 cases**. It adds admission/completion +allocation failures, lost final wakeups, interrupted native opens, short/root +close errors before and after OS completion, no-retry cleanup, incompatible +helper versions, valid truncated sources, and old API shapes. The historical +qualifier additionally executes the actual previous helpers and previous +coordinator with the updated helpers, including fatal cleanup. Ordinary +tests need no experimental commit history or network fetch. + +**Protocol v1 is unchanged.** The plan/claim schema, tokens, path keys, lock +namespace/order, reference validator, publication and recovery methods are +AST-identical to the reviewed starting revision. Valid installations need no +migration, cache reset, regeneration or token rotation. Internal helper +contracts `(commit=2, ownership=1, path=1)` identify complete compatible Python +sources and do not change any on-disk format. Packaging installs the sibling +helpers; incompatible installations use reference before creating a read set. + +The default now stays reference on every platform. The hidden indexed CLI and +private mode cannot bypass the closed promotion guard. Only isolated fixtures +and the mutation-forbidden qualification harness override their own module. +Existing CMake commands keep working, with continued progress during long +reference validation and no new configuration or runtime dependency. + +## Remaining limits and next gate + +Native IO must finish before workers and roots can retire, so a blocked native +read can delay cancellation. Uncertain native cleanup aborts the operation. +The read set certifies past positive intervals with fresh negative probes; +it does not freeze the namespace or replace the existing cooperative-writer +and mutation-time boundaries. Capabilities and timing were exercised on one +Windows/NTFS host with reused OS caches, not a universal platform/load matrix. + +Before enabling the index again, improve worst-case headroom while preserving +all checks, then repeat the complete loaded and ordinary-default timing series +against the final source. The current failure remains a promotion blocker. + +The [machine-readable report](mr55-review-results.json) records source hashes, +unchanged-AST assertions, every timing sample/counter, oracle receipts, the +preservation audit and all 115 upgrade cases. diff --git a/docs/observation-commit-contract.md b/docs/observation-commit-contract.md index e5b7253..902b858 100644 --- a/docs/observation-commit-contract.md +++ b/docs/observation-commit-contract.md @@ -1,13 +1,13 @@ # Experimental observation commit -Status: qualified parallel `indexed` validation is the automatic Windows default -on `codex/experimental-generation-engine`. The -[parallel-probe qualification](parallel-probe-results.md) passed 20/20 complete -retained-workload validations below 30 seconds, including ten under concurrent -reference-reader load. Index authority still requires a verified certificate, -complete worker retirement, and balanced native handle accounting. Unsupported -or unverified observations use reference validation; failed worker retirement -aborts before mutation. `commit-shadow` remains available for differential checks. +Status: index promotion is **closed** on `codex/experimental-generation-engine`. +The [MR review](mr55-review-results.md) fixed concurrency, cleanup and partial-upgrade +issues, but its repeat timing gate exceeded 30 seconds. Normal consumer commands +use reference validation; neither the hidden indexed flag nor the private mode +can override the source guard. Only isolated fixtures and the mutation-forbidden +qualification harness can exercise index authority in their own module. +`commit-shadow` remains available for differential checks with reference authority. +The earlier [parallel qualification](parallel-probe-results.md) is historical. This replaces the previous fresh-observation experiment's repeated full path walks with a provisional read set. Its certificate verifies the requested native @@ -58,6 +58,13 @@ the canonical native spelling. Case variants, short-name aliases, and other noncanonical spellings fall back. This is a correctness boundary, not a path normalization performed on behalf of the caller. +Trusted helper sources advertise internal contracts only at EOF: +`commit=2`, `ownership=1`, and `path=1`. Caller and helper-entry checks require +exact integer versions before acquiring native resources or building an index. +Entry checks also protect older coordinators that do not inspect those markers. +An incomplete or incompatible installation uses reference validation; these +markers do not change the v1 ownership format or require a consumer setting. + ## Positive read-set argument For each unique positive object, the prototype performs these steps: @@ -183,6 +190,11 @@ views or releasing root handles. Interruptions during the drain are deferred until native work retires. No comparison can run during sealing or after root release, and a failed seal grants no index authority. +Admission bookkeeping belongs inside the same retirement `finally` as native +work. Active work retires before optional completion accounting. The drain uses +a bounded condition wait to recheck its fence if a worker's final notification +fails; a lost wakeup cannot strand an already-retired pool. + A comparison error with successful cleanup can fall back to reference. Failure to retire the pool safely raises a fatal coordinator error before reference can authorize reconciliation. If retirement is unproved, cleanup preserves the @@ -192,6 +204,16 @@ completed-comparison accounting equal to the requested count, a verified seal, and complete native-handle closure. Shutdown and cancellation errors are not treated as successful retirement. +An exception can arrive after a native open writes an output handle but before +the caller receives it. The native wrapper releases that unpublished handle +exactly once and accounts for it before propagating the exception. Any failed +native release or unbalanced final accounting is fatal before reference can +authorize mutation, including failures involving short opens or volume roots. +Uncertain close completion is latched: numeric handles are never retried because +the OS may already have consumed and reused their value. Remaining known roots +close once; the operation stays failed. See +[CloseHandle usage](https://learn.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-closehandle). + ## Expiry, fallback, and operational costs Instances are local to one validation phase. Sealing disables further reads; @@ -227,10 +249,9 @@ or tokens. An exception records its type, not its message. ## Upgrade contract and qualification gate -Normal Windows installations automatically attempt qualified indexed validation; -other platforms continue to use reference validation. Every invocation checks -the native capabilities and certificate described above. Existing consumer -commands and CMake configuration need no changes. To force reference validation +Normal installations use reference validation on every platform while the +promotion guard is closed. Existing consumer commands and CMake configuration +need no changes. To explicitly select reference validation for an existing build, set `PROTOCYTE_REGISTRY_VALIDATION=reference` in its environment. Direct coordinator commands also accept `--reference-registry-validation`. The environment accepts `auto` (the default) @@ -250,7 +271,8 @@ skipping the record. Valid registries need no migration, reset, regeneration, or token rotation. Malformed or unreadable recorded state requires its underlying problem to be repaired rather than being skipped. -The parallel qualification supplies evidence for the following promotion gates: +The following promotion gates remain required. Correctness and upgrade evidence +is recorded in the review; repeat timing failed and blocks promotion: - Relevant native mutation semantics and fallback behavior are qualified for the enabled capability, with the namespace and writer boundaries above explicit. @@ -266,7 +288,8 @@ The read-only qualification harness reports the entire validation cost, includin plan parsing, witness verification, worker retirement, and native-handle release, separately from its optional reference oracle. It produces no tokens and authorizes no reconciliation. The default-mode qualification exercises ordinary -production selection with the source gate enabled. Ordinary `commit-shadow` +production selection when the source gate is enabled. The review does not enable +that source gate. Ordinary `commit-shadow` timings always include the mandatory reference pass; candidate timing must never be presented as that full operation. The timing evidence covers the retained workload and measured host, not a universal latency bound on every installation. diff --git a/docs/observation-commit-results.md b/docs/observation-commit-results.md index 76b2753..f042dfc 100644 --- a/docs/observation-commit-results.md +++ b/docs/observation-commit-results.md @@ -4,7 +4,8 @@ This is the historical synthetic qualification at commit `0fe8ad4`. Its source fingerprints and closed promotion decision are retained below. See the newer [retained consumer qualification](consumer-validation-results.md) for subsequent serial measurements and the [parallel-probe qualification](parallel-probe-results.md) -for the current integration decision. The disabled default described below is +for the initial enablement. The subsequent [MR review](mr55-review-results.md) +records the current closed promotion decision. The disabled default below is the historical decision for this synthetic snapshot. The index remains **disabled as an authority** on diff --git a/docs/parallel-probe-results.md b/docs/parallel-probe-results.md index fc00292..9f3deb6 100644 --- a/docs/parallel-probe-results.md +++ b/docs/parallel-probe-results.md @@ -1,5 +1,11 @@ # Parallel-probe qualification +Historical qualification at `1d1e1b0`. The subsequent +[MR review](mr55-review-results.md) fixed correctness and upgrade issues, then +failed the repeat timing gate. **The current source gate is closed and the +default is reference validation.** The initial enablement described below is +preserved as historical evidence. + **Passed: 20/20 complete validations below 30 seconds.** The experimental branch now automatically uses the committed index on qualified Windows invocations. The enabled default took **14.489–16.538 seconds**, with a diff --git a/docs/wiki/Contributing.md b/docs/wiki/Contributing.md index ef551b1..8961d46 100644 --- a/docs/wiki/Contributing.md +++ b/docs/wiki/Contributing.md @@ -124,14 +124,26 @@ during a measurement. See the experiment's [results](../experimental-index-results.md) and [correctness contract](../experimental-index-contract.md) before interpreting the preview numbers. That sampled experiment always retains reference authority. -The subsequent committed index is now the automatic Windows default when native -capabilities and its complete certificate are verified; see the -[parallel qualification](../parallel-probe-results.md) and +The subsequent committed index remains behind a closed source promotion guard +after the [MR review](../mr55-review-results.md) failed repeat timing. See the +[historical parallel qualification](../parallel-probe-results.md) and [observation contract](../observation-commit-contract.md). Unsupported or unverified observations fall back to reference validation. Set `PROTOCYTE_REGISTRY_VALIDATION=reference` to compare an existing build using the reference path. +Actual historical helper/coordinator interoperability checks run separately: + +```console +python tests/verify_coordinator_upgrade.py --work .pytest-tmp/upgrade-new +``` + +That explicit qualifier needs the pinned public source blobs and checkpoints +listed in its source. It checks 115 upgrade, rollback, cleanup and recovery cases +in fresh private registries. Routine unit tests are self-contained and do not +require unmerged branch history, a full checkout or a network fetch. Publish only +the sanitized result receipt, not fixture records or subprocess logs. + The fresh native-reader investigation can be measured with `--registry-validation native-shadow` in the scaling benchmark or POC. It keeps the cross product and fresh physical checks, then always runs reference validation. diff --git a/docs/wiki/Troubleshooting.md b/docs/wiki/Troubleshooting.md index 469dfdc..6041605 100644 --- a/docs/wiki/Troubleshooting.md +++ b/docs/wiki/Troubleshooting.md @@ -208,14 +208,13 @@ wait includes preparing and acquiring its lock files. `registry_entries` counts state directories, including any abandoned initialization directories encountered; `claims_checked` counts authenticated claim/plan records. -On supported Windows/NTFS installations, registry validation automatically uses -the qualified committed index. Unsupported capabilities or an unverified -observation use full reference validation, which can take longer. Existing -builds need no migration, registry reset, or new configuration. To force the +Registry validation currently uses the full reference validator. The experimental +index remains gated after its repeat timing qualification exceeded 30 seconds; +see the [MR review](../mr55-review-results.md). Existing builds need no migration, +registry reset, or new configuration. To explicitly select the reference validator while diagnosing an installation, set `PROTOCYTE_REGISTRY_VALIDATION=reference` in the build environment; remove it to -restore automatic selection. See the -[qualification and limits](../parallel-probe-results.md). +restore automatic selection, which remains reference while promotion is closed. If cleanup refuses an unsafe path or cannot remove it, the diagnostic warns that inert staging data outside `OUT_DIR` may remain. Stop related processes and remove only the named staging path after inspecting it. diff --git a/tests/test_consumer_registry_qualification.py b/tests/test_consumer_registry_qualification.py index f68b709..2ace4b9 100644 --- a/tests/test_consumer_registry_qualification.py +++ b/tests/test_consumer_registry_qualification.py @@ -161,6 +161,7 @@ def certificate(self, *args, **kwargs): commit_certificate="verified", commit_state="closed", commit_handles_opened=1, + commit_cleanup_failed=False, commit_handles_closed=1, commit_claims_checked=1, commit_probe_state="closed", diff --git a/tests/test_observation_commit.py b/tests/test_observation_commit.py index de992c3..485e030 100644 --- a/tests/test_observation_commit.py +++ b/tests/test_observation_commit.py @@ -692,6 +692,7 @@ def test_indexed_incomplete_certificate_runs_reference_before_mutation( def incomplete(*args, **kwargs): engine.validation_metrics.update( + commit_cleanup_failed=False, commit_probe_state="closed", commit_probe_native_retired=True, commit_probe_active=0, diff --git a/tests/test_parallel_probes.py b/tests/test_parallel_probes.py index 091d1a1..05c9669 100644 --- a/tests/test_parallel_probes.py +++ b/tests/test_parallel_probes.py @@ -6,7 +6,6 @@ import os import random import sys -import subprocess import threading from pathlib import Path @@ -143,6 +142,8 @@ def test_invalid_default_override_is_rejected_and_explicit_reference_recovers( {"commit_probe_pending": False}, {"commit_probe_comparisons": 1}, {"commit_probe_comparisons": False}, + {"commit_cleanup_failed": True}, + {"commit_cleanup_failed": 0}, ], ) def test_incomplete_worker_accounting_cannot_authorize_mutation( @@ -162,6 +163,7 @@ def incomplete(*args, **kwargs): engine.validation_metrics.update( commit_certificate="verified", commit_state="closed", + commit_cleanup_failed=False, commit_handles_opened=2, commit_handles_closed=2, commit_probe_state="closed", @@ -203,7 +205,9 @@ def compare(number): @pytest.mark.parametrize("error_type", [RuntimeError, KeyboardInterrupt, SystemExit]) -@pytest.mark.parametrize("site", ["worker", "submit-after-queue", "shutdown", "wait"]) +@pytest.mark.parametrize( + "site", ["worker", "submit-after-queue", "shutdown", "wait", "notify"] +) def test_every_failure_drains_admitted_work(error_type, site): first_started = threading.Event() second_started = threading.Event() @@ -217,7 +221,7 @@ def compare(number): if number == 0: first_started.set() assert second_started.wait(5) - if site in ("worker", "shutdown", "wait"): + if site in ("worker", "shutdown", "wait", "notify"): failed.set() raise error_type("injected worker failure") assert release.wait(5) @@ -252,19 +256,30 @@ def shutdown(**kwargs): raise error_type("injected shutdown failure") session._executor.shutdown = shutdown - if site == "wait": + if site in ("wait", "notify"): real_wait = session._condition.wait interrupted = False def wait(*args, **kwargs): nonlocal interrupted - if not interrupted: + if site == "notify": + wait_interrupted.set() + elif not interrupted: interrupted = True wait_interrupted.set() raise error_type("injected interruption while draining") return real_wait(*args, **kwargs) session._condition.wait = wait + if site == "notify": + real_notify = session._condition.notify_all + + def notify(): + if session._active == 0: + raise error_type("injected final retirement notification failure") + return real_notify() + + session._condition.notify_all = notify try: session.compare((number, number) for number in range(128)) except BaseException as error: @@ -280,7 +295,7 @@ def wait(*args, **kwargs): thread.start() try: assert first_started.wait(5) and second_started.wait(5) and failed.wait(5) - if site == "wait": + if site in ("wait", "notify"): assert wait_interrupted.wait(5) assert not finished.is_set(), ( "retired a session with an admitted query still active" @@ -308,6 +323,61 @@ def wait(*args, **kwargs): session._run(object()) +@pytest.mark.parametrize("error_type", [MemoryError, KeyboardInterrupt, SystemExit]) +@pytest.mark.parametrize("site", ["admission", "completion"]) +def test_worker_bookkeeping_failure_retires_without_holding_owner(error_type, site): + failed = threading.Event() + finished = threading.Event() + sessions, errors = [], [] + + class ThreadSet(set): + def add(self, item): + failed.set() + raise error_type("injected admission bookkeeping failure") + + class ComparisonCount(int): + def __add__(self, value): + failed.set() + raise error_type("injected completion bookkeeping failure") + + def control(): + session = commit.ProbeSession(lambda value: False, workers=1) + sessions.append(session) + if site == "admission": + session._threads = ThreadSet() + else: + session._comparisons = ComparisonCount(0) + try: + session.compare([(0, None)]) + except BaseException as error: + errors.append(error) + finally: + try: + session.close() + finally: + finished.set() + + owner = threading.Thread(target=control) + owner.start() + try: + assert failed.wait(5) + retired = finished.wait(5) + finally: + if not finished.is_set(): + # Bound this regression even on the old implementation's leaked + # counter. No native query ran in this isolated faulting session. + with sessions[0]._condition: + sessions[0]._active = 0 + sessions[0]._condition.notify_all() + owner.join(timeout=10) + assert retired, "worker accounting stranded the owner in close()" + assert not owner.is_alive() and len(errors) == 1 + assert isinstance(errors[0], error_type) + assert sessions[0].native_retired + assert sessions[0].metrics()["commit_probe_active"] == 0 + assert sessions[0].metrics()["commit_probe_pending"] == 0 + + def test_parallel_index_matches_serial_on_randomized_ownership_and_retirement(): def overlaps(pair): left, right = pair @@ -575,22 +645,230 @@ def failed_comparison(self, prepared): assert metrics["commit_handles_opened"] == metrics["commit_handles_closed"] +@pytest.mark.parametrize("site", ["short-open", "root"]) +@pytest.mark.parametrize( + "failure", + ["false", "exception", "interrupt", "after-close", "after-close-interrupt"], +) +def test_native_release_failure_aborts_before_reference_or_mutation( + tmp_path, scope, monkeypatch, site, failure +): + plan = helpers._write_plan( + tmp_path / "current.plan", + tmp_path / "generated", + tmp_path / "build", + ((helpers._target("failed-release"), "sample.protocyte.hpp"),), + ) + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="reference" + ) + token = engine.reconcile(plan) + state = engine._state_directory(plan.root) + before = {path.name: path.read_bytes() for path in state.iterdir()} + original = commit.WindowsObservationCommit.__init__ + scopes, attempts, manual_cleanup = [], [], [] + + def initialize(readset, *args, **kwargs): + original(readset, *args, **kwargs) + scopes.append(readset) + raw_close = readset.reader._close + + def close(handle): + is_root = any( + volume.handle is handle for volume in readset._volumes.values() + ) + if (site == "root") == is_root and not attempts: + attempts.append(handle) + if failure in ("after-close", "after-close-interrupt"): + assert raw_close(handle) + if failure == "after-close-interrupt": + raise KeyboardInterrupt( + "interrupted after the OS closed the handle" + ) + raise RuntimeError("failed after the OS closed the handle") + manual_cleanup.append((raw_close, handle)) + if failure == "exception": + raise RuntimeError("injected native release failure") + if failure == "interrupt": + raise KeyboardInterrupt("injected native release interruption") + return False + if attempts and handle is attempts[0]: + attempts.append(handle) + return raw_close(handle) + + readset.reader._close = close + + monkeypatch.setattr(commit.WindowsObservationCommit, "__init__", initialize) + monkeypatch.setattr( + engine, + "_validate_registry_reference", + lambda *a, **k: pytest.fail("failed native cleanup authorized reference"), + ) + monkeypatch.setattr( + engine, + "_reconcile_locked", + lambda *a, **k: pytest.fail("failed native cleanup authorized mutation"), + ) + engine.registry_validation = "indexed" + expected = ( + KeyboardInterrupt + if failure in ("interrupt", "after-close-interrupt") + else coordinator.CoordinatorError + ) + try: + with pytest.raises(expected): + engine.reconcile(plan) + finally: + # Only the injector knows that these failures occurred before the OS + # call. Production must treat their completion as uncertain. + for raw_close, handle in manual_cleanup: + assert raw_close(handle) + assert len(attempts) == 1, "retried a native handle after uncertain completion" + assert {path.name: path.read_bytes() for path in state.iterdir()} == before + assert coordinator._load_json(state / "claim.json", "claim")["token"] == token + assert len(scopes) == 1 + metrics = scopes[0].metrics() + assert metrics["commit_cleanup_failed"] + assert metrics["commit_state"] == "failed" + assert metrics["commit_handles_opened"] == metrics["commit_handles_closed"] + 1 + + +def test_failed_scope_close_never_retries_an_uncertain_handle( + scope, tmp_path, monkeypatch +): + readset = commit.WindowsObservationCommit( + coordinator._load_path_observation(), model + ) + readset.project(tmp_path) + roots = { + id(guard.handle): guard.handle + for guard in readset._objects.values() + if guard.handle + } + raw_close = readset.reader._close + attempts = [] + + def close(handle): + if id(handle) in roots: + attempts.append(handle) + return False + return raw_close(handle) + + monkeypatch.setattr(readset.reader, "_close", close) + try: + for _ in range(2): + with pytest.raises(commit.ProbeCleanupFailed): + readset.close() + assert len(attempts) == len(roots) + metrics = readset.metrics() + assert metrics["commit_state"] == "failed" + assert metrics["commit_handles_opened"] > metrics["commit_handles_closed"] + finally: + for handle in roots.values(): + assert raw_close(handle) + + +@pytest.mark.parametrize("site", ["root", "relative"]) +@pytest.mark.parametrize("error_type", [RuntimeError, KeyboardInterrupt, SystemExit]) +@pytest.mark.parametrize("failed_close", [False, True]) +def test_interrupted_native_open_releases_unpublished_handle_before_fallback( + tmp_path, scope, monkeypatch, site, error_type, failed_close +): + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="reference" + ) + plan = helpers._write_plan( + tmp_path / "plan", + tmp_path / "generated", + tmp_path / "build", + ((helpers._target("interrupted-open"), "sample.protocyte.hpp"),), + ) + token = engine.reconcile(plan) + state = engine._state_directory(plan.root) + claim = (state / "claim.json").read_bytes() + original = commit.WindowsObservationCommit.__init__ + scopes, handles, opened = [], [], [] + closed_values = set() + + def initialize(readset, *args, **kwargs): + original(readset, *args, **kwargs) + scopes.append(readset) + raw_open, raw_close = readset.reader._open, readset.reader._close + + def open_native(*args): + status = raw_open(*args) + is_root = not args[2]._obj.RootDirectory + if status >= 0 and (site == "root") == is_root and not handles: + value = ctypes.cast( + args[0], ctypes.POINTER(readset.w.HANDLE) + ).contents.value + handles.append(value) + opened.append((raw_close, readset.w.HANDLE(value))) + raise error_type("injected exception after native open completed") + return status + + def close(handle): + if failed_close and handles and handle.value == handles[0]: + return False + result = raw_close(handle) + if result: + closed_values.add(handle.value) + return result + + readset.reader._open = open_native + readset.reader._close = close + + monkeypatch.setattr(commit.WindowsObservationCommit, "__init__", initialize) + engine.registry_validation = "indexed" + try: + if failed_close: + monkeypatch.setattr( + engine, + "_validate_registry_reference", + lambda *a, **k: pytest.fail( + "unreleased native open used reference authority" + ), + ) + with pytest.raises(coordinator.CoordinatorError): + engine.reconcile(plan) + elif error_type is RuntimeError: + assert engine.reconcile(plan) == token + assert engine.validation_metrics["fallback"] == "reference" + assert engine.validation_metrics["reference_result"] == "accepted" + else: + with pytest.raises(error_type): + engine.reconcile(plan) + finally: + for raw_close, handle in opened: + if handle.value not in closed_values: + assert raw_close(handle) + assert len(handles) == 1 and len(scopes) == 1 + metrics = scopes[0].metrics() + assert metrics["commit_handles_opened"] > 0 + assert metrics["commit_handles_opened"] == metrics["commit_handles_closed"] + int( + failed_close + ) + assert (state / "claim.json").read_bytes() == claim + + +@pytest.mark.parametrize("previous_has_cleanup_error", [False, True]) def test_previous_helper_during_upgrade_uses_reference_without_token_rotation( - tmp_path, monkeypatch + tmp_path, monkeypatch, previous_has_cleanup_error ): from types import ModuleType - source = tmp_path / "previous-observation-helper.py" - repo = Path(__file__).resolve().parents[1] - source.write_bytes( - subprocess.check_output( - ["git", "show", "8851bde:cmake/ProtocyteObservationCommit.py"], cwd=repo - ) - ) previous = ModuleType("previous_observation_helper") - sys.modules[previous.__name__] = previous - exec(compile(source.read_bytes(), str(source), "exec"), previous.__dict__) - assert not hasattr(previous, "ProbeCleanupFailed") + # Both pre-pool and pre-review helper API shapes remain safe fallbacks. + # Actual pinned implementations run in verify_coordinator_upgrade.py; + # ordinary unit tests must work in archives and shallow/squashed checkouts. + if previous_has_cleanup_error: + previous.ProbeCleanupFailed = type("ProbeCleanupFailed", (RuntimeError,), {}) + assert not hasattr(previous, "COMMIT_CONTRACT_VERSION") + + def unavailable(*args, **kwargs): + pytest.fail("opened an incompatible helper during a partial upgrade") + + previous.WindowsObservationCommit = unavailable engine = coordinator.OutputCoordinator( tmp_path / "locks", registry_validation="reference" ) @@ -610,3 +888,143 @@ def test_previous_helper_during_upgrade_uses_reference_without_token_rotation( assert engine.validation_metrics["fallback"] == "reference" assert engine.validation_metrics["reference_result"] == "accepted" assert (state / "claim.json").read_bytes() == claim + + +@pytest.mark.parametrize("contract", [None, False, 1, 3, "2", 2.0]) +def test_unknown_helper_contract_falls_back_before_acquiring_handles( + tmp_path, monkeypatch, contract +): + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="reference" + ) + plan = helpers._write_plan( + tmp_path / "plan", + tmp_path / "generated", + tmp_path / "build", + ((helpers._target("helper-contract"), "sample.protocyte.hpp"),), + ) + token = engine.reconcile(plan) + monkeypatch.setattr(commit, "COMMIT_CONTRACT_VERSION", contract) + monkeypatch.setattr( + commit, + "WindowsObservationCommit", + lambda *a, **k: pytest.fail("opened a scope through an incompatible helper"), + ) + engine.registry_validation = "indexed" + assert engine.reconcile(plan) == token + assert engine.validation_metrics["fallback"] == "reference" + assert engine.validation_metrics["reference_result"] == "accepted" + assert "commit_handles_opened" not in engine.validation_metrics + + +@pytest.mark.parametrize("dependency", ["ownership", "path"]) +@pytest.mark.parametrize("contract", [None, True, 0, 2, "1", 1.0]) +def test_unknown_dependency_contract_falls_back_before_acquiring_handles( + tmp_path, monkeypatch, dependency, contract +): + module, marker = ( + (model, "OWNERSHIP_CONTRACT_VERSION") + if dependency == "ownership" + else (coordinator._load_path_observation(), "PATH_CONTRACT_VERSION") + ) + monkeypatch.setattr(module, marker, contract) + monkeypatch.setattr( + commit, + "WindowsObservationCommit", + lambda *a, **k: pytest.fail( + "opened a scope through an incompatible dependency" + ), + ) + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="indexed" + ) + plan = helpers._write_plan( + tmp_path / "plan", + tmp_path / "generated", + tmp_path / "build", + ((helpers._target("dependency-contract"), "sample.protocyte.hpp"),), + ) + assert engine.reconcile(plan) + assert engine.validation_metrics["fallback"] == "reference" + assert "commit_handles_opened" not in engine.validation_metrics + + +@pytest.mark.parametrize( + "filename,marker,loader", + [ + ( + "ProtocyteObservationCommit.py", + "COMMIT_CONTRACT_VERSION", + "_load_observation_commit", + ), + ( + "ProtocyteOwnershipIndex.py", + "OWNERSHIP_CONTRACT_VERSION", + "_load_ownership_index", + ), + ( + "ProtocytePathObservation.py", + "PATH_CONTRACT_VERSION", + "_load_path_observation", + ), + ], +) +def test_valid_truncated_helper_cannot_authorize_an_index( + tmp_path, monkeypatch, filename, marker, loader +): + from types import ModuleType + + path = Path(__file__).resolve().parents[1] / "cmake" / filename + source = path.read_text() + if filename == "ProtocyteObservationCommit.py": + # Keep a valid but incomplete conflict() that checks roots and then + # implicitly accepts without checking current staging reservations. + source = source.rsplit(" for target, path in staging:", 1)[0] + else: + source = source.rsplit(marker + " =", 1)[0] + incomplete = ModuleType(f"incomplete_helper_{next(_modules)}") + sys.modules[incomplete.__name__] = incomplete + exec(compile(source, filename, "exec"), incomplete.__dict__) + assert not hasattr(incomplete, marker) + # Older coordinators do not inspect the marker themselves. The helper's + # entry point must reject the partial file before touching OS resources. + if filename == "ProtocyteObservationCommit.py": + with pytest.raises(incomplete.CapabilityUnavailable, match="incomplete"): + incomplete.WindowsObservationCommit( + coordinator._load_path_observation(), model + ) + elif filename == "ProtocytePathObservation.py": + with pytest.raises(incomplete.ObservationUnavailable, match="incomplete"): + incomplete.FreshPathObserver() + else: + with pytest.raises(RuntimeError, match="incomplete"): + incomplete.OwnershipIndex(()) + monkeypatch.setattr(coordinator, loader, lambda: incomplete) + engine = coordinator.OutputCoordinator( + tmp_path / "locks", registry_validation="indexed" + ) + target = helpers._target("truncated-contract") + current_root = tmp_path / "generated" + staging = tmp_path / f".protocyte-generation-staging-{target}" + retained = helpers._write_plan( + tmp_path / "retained.plan", + staging / "foreign", + tmp_path / "old-build", + ((helpers._target("foreign"), "old.protocyte.hpp"),), + ) + engine.registry_validation = "reference" + engine.reconcile(retained) + current = helpers._write_plan( + tmp_path / "current.plan", + current_root, + tmp_path / "build", + ((target, "sample.protocyte.hpp"),), + ) + engine.registry_validation = "indexed" + with pytest.raises( + coordinator.CoordinatorError, match="staging overlaps a claimed output root" + ): + engine.reconcile(current) + assert engine.validation_metrics["fallback"] == "reference" + assert engine.validation_metrics["reference_result"] == "rejected" + assert not engine._state_directory(current.root).exists() diff --git a/tests/verify_consumer_registry.py b/tests/verify_consumer_registry.py index e62c0a9..363d213 100644 --- a/tests/verify_consumer_registry.py +++ b/tests/verify_consumer_registry.py @@ -330,6 +330,7 @@ def unexpected_reference(*args, **kwargs): assert metrics["commit_certificate"] == "verified" assert metrics["commit_state"] == "closed" assert metrics["commit_handles_opened"] == metrics["commit_handles_closed"] + assert metrics["commit_cleanup_failed"] is False assert metrics["commit_probe_state"] == "closed" assert metrics["commit_probe_native_retired"] is True assert metrics["commit_probe_active"] == metrics["commit_probe_pending"] == 0 diff --git a/tests/verify_coordinator_upgrade.py b/tests/verify_coordinator_upgrade.py index 00e0902..ab0066d 100644 --- a/tests/verify_coordinator_upgrade.py +++ b/tests/verify_coordinator_upgrade.py @@ -394,6 +394,123 @@ def run(version: str, command: str, locks: Path, plan: Path, extras=(), crash=No } ) + # Historical source checks are deliberately in this explicit qualifier, + # not routine unit tests: a squash merge need not retain branch commits. + mixed_source_hashes = {} + for revision in ("8851bde", "1d1e1b0"): + path = WORK / f"legacy/helper-{revision}.py" + path.write_bytes( + subprocess.check_output( + ["git", "show", f"{revision}:cmake/ProtocyteObservationCommit.py"], + cwd=REPO, + ) + ) + previous_helper = load(f"mixed_helper_{revision}", path) + mixed_source_hashes[f"helper-{revision}"] = hashlib.sha256( + path.read_bytes() + ).hexdigest() + root, locks, plan_file, _, _ = fixture(f"mixed-helper-{revision}") + reader = engine("reference", locks) + plan = new.Plan.read(plan_file) + token = reader.reconcile(plan) + state = reader._state_directory(root) + claim = (state / "claim.json").read_bytes() + load_commit, commit_module = ( + new._load_observation_commit, + new._observation_commit_module, + ) + try: + new._load_observation_commit = lambda: previous_helper + new._observation_commit_module = previous_helper + reader.registry_validation = "indexed" + assert reader.reconcile(plan) == token + assert reader.validation_metrics["fallback"] == "reference" + assert reader.validation_metrics["reference_result"] == "accepted" + assert "commit_handles_opened" not in reader.validation_metrics + assert (state / "claim.json").read_bytes() == claim + finally: + new._load_observation_commit, new._observation_commit_module = ( + load_commit, + commit_module, + ) + results.append( + { + "kind": "actual-previous-helper-reference-fallback", + "revision": revision, + "passed": True, + } + ) + + path = WORK / "legacy/pre-review-coordinator.py" + path.write_bytes( + subprocess.check_output( + ["git", "show", "1d1e1b0:cmake/ProtocyteOutputCoordinator.py"], cwd=REPO + ) + ) + previous = load("mixed_previous_coordinator", path) + mixed_source_hashes["coordinator-1d1e1b0"] = hashlib.sha256( + path.read_bytes() + ).hexdigest() + previous._COMMITTED_INDEX_QUALIFIED = True + previous._load_ownership_index = new._load_ownership_index + previous._load_path_observation = new._load_path_observation + previous._load_observation_commit = new._load_observation_commit + updated_helper = new._load_observation_commit() + previous._observation_commit_module = updated_helper + for failed_cleanup in (False, True): + root, locks, plan_file, _, _ = fixture( + f"previous-coordinator-updated-helper-{failed_cleanup}" + ) + reader = previous.OutputCoordinator(locks, registry_validation="reference") + plan = previous.Plan.read(plan_file) + token = reader.reconcile(plan) + claim = (reader._state_directory(root) / "claim.json").read_bytes() + constructor = updated_helper.WindowsObservationCommit.__init__ + failed = [] + if failed_cleanup: + + def initialize(readset, *args, **kwargs): + constructor(readset, *args, **kwargs) + raw_close = readset.reader._close + + def close(handle): + if not failed: + failed.append((raw_close, handle)) + return False + return raw_close(handle) + + readset.reader._close = close + + updated_helper.WindowsObservationCommit.__init__ = initialize + try: + reader.registry_validation = "indexed" + if failed_cleanup: + try: + reader.reconcile(plan) + except previous.CoordinatorError as error: + assert "could not be retired safely" in str(error) + else: + raise AssertionError( + "previous coordinator accepted failed native cleanup" + ) + assert reader.validation_metrics["reference_wall_seconds"] == 0.0 + else: + assert reader.reconcile(plan) == token + assert reader.validation_metrics["authoritative"] == "index" + assert (reader._state_directory(root) / "claim.json").read_bytes() == claim + finally: + updated_helper.WindowsObservationCommit.__init__ = constructor + # Only the injector knows that no OS close was attempted. + for raw_close, handle in failed: + assert raw_close(handle) + results.append( + { + "kind": "actual-previous-coordinator-updated-helper", + "failed_cleanup": failed_cleanup, + "passed": True, + } + ) + assert { path.name: hashlib.sha256(path.read_bytes()).hexdigest() for path in IMPLEMENTATION @@ -414,6 +531,7 @@ def run(version: str, command: str, locks: Path, plan: Path, extras=(), crash=No "ProtocyteObservationCommit.py", ) }, + "mixed_source_sha256": mixed_source_hashes, "unchanged_ast_methods_since_checkpoint": unchanged, "reference_validator_ast_unchanged_since_checkpoint": reference_unchanged, "file_lock_ast_unchanged_since_checkpoint": True, From bb2db5576805dfa26bdca7ee9717ddb16807ff50 Mon Sep 17 00:00:00 2001 From: Anthony Printup <92564080+anthonyprintup@users.noreply.github.com> Date: Tue, 17 Nov 2026 00:05:17 +0100 Subject: [PATCH 12/12] perf(coordinator): enable reviewed validation and trim investigation docs Enable automatic native indexed validation on supported Windows installations after correctness, concurrency, cleanup and upgrade qualification. Preserve all runtime capability, witness, worker-retirement and handle-cleanup checks, with full reference fallback and no protocol-v1 migration or token rotation. The observed 30.115-second loaded result was explicitly accepted for merging. Remove the 21 investigation reports, design notes, internal contracts and measurement datasets from the final documentation tree. Retain the evidence locally and limit the public documentation change to progress, automatic validation and reference-fallback troubleshooting. Restore the original contributor guide and use production descriptions and progress labels. Validation: 1983 default tests, 22 CMake packaging tests and all 115 actual-source upgrade/recovery cases passed with production enablement active. Fresh-process original-workload default checks have verified index authority and complete cleanup; all completed measurements remain recorded locally. --- cmake/ProtocyteObservationCommit.py | 2 +- cmake/ProtocyteOutputCoordinator.py | 11 +- cmake/ProtocyteOwnershipIndex.py | 7 +- cmake/ProtocytePathObservation.py | 4 +- docs/consumer-validation-results.json | 2206 ----------------- docs/consumer-validation-results.md | 171 -- docs/experimental-index-contract.md | 89 - docs/experimental-index-results.json | 259 -- docs/experimental-index-results.md | 154 -- docs/generation-engine-proposal.md | 237 -- docs/mr55-review-results.json | 1632 ------------ docs/mr55-review-results.md | 154 -- docs/observation-commit-contract.md | 295 --- docs/observation-commit-results.json | 1492 ----------- docs/observation-commit-results.md | 208 -- docs/observation-mechanism-results.json | 830 ------- docs/observation-mechanism-results.md | 140 -- docs/parallel-probe-results.json | 2741 --------------------- docs/parallel-probe-results.md | 219 -- docs/registry-validation-30s-plan.md | 175 -- docs/registry-validation-design.md | 139 -- docs/registry-validation-feasibility.json | 57 - docs/registry-validation-refinements.md | 198 -- docs/registry-validation-results.json | 2731 -------------------- docs/registry-validation-results.md | 153 -- docs/wiki/Contributing.md | 80 +- docs/wiki/Troubleshooting.md | 10 +- 27 files changed, 18 insertions(+), 14376 deletions(-) delete mode 100644 docs/consumer-validation-results.json delete mode 100644 docs/consumer-validation-results.md delete mode 100644 docs/experimental-index-contract.md delete mode 100644 docs/experimental-index-results.json delete mode 100644 docs/experimental-index-results.md delete mode 100644 docs/generation-engine-proposal.md delete mode 100644 docs/mr55-review-results.json delete mode 100644 docs/mr55-review-results.md delete mode 100644 docs/observation-commit-contract.md delete mode 100644 docs/observation-commit-results.json delete mode 100644 docs/observation-commit-results.md delete mode 100644 docs/observation-mechanism-results.json delete mode 100644 docs/observation-mechanism-results.md delete mode 100644 docs/parallel-probe-results.json delete mode 100644 docs/parallel-probe-results.md delete mode 100644 docs/registry-validation-30s-plan.md delete mode 100644 docs/registry-validation-design.md delete mode 100644 docs/registry-validation-feasibility.json delete mode 100644 docs/registry-validation-refinements.md delete mode 100644 docs/registry-validation-results.json delete mode 100644 docs/registry-validation-results.md diff --git a/cmake/ProtocyteObservationCommit.py b/cmake/ProtocyteObservationCommit.py index a943b4e..ef8893f 100644 --- a/cmake/ProtocyteObservationCommit.py +++ b/cmake/ProtocyteObservationCommit.py @@ -1,4 +1,4 @@ -"""Experimental optimistic read-set commit; never standalone mutation authority. +"""Transient native read-set commit; never standalone mutation authority. Positive objects use root-anchored short opens and exact ID/version witnesses. Only volume roots retain handles; foreign build directories are not pinned. diff --git a/cmake/ProtocyteOutputCoordinator.py b/cmake/ProtocyteOutputCoordinator.py index 750a2f3..09ec670 100644 --- a/cmake/ProtocyteOutputCoordinator.py +++ b/cmake/ProtocyteOutputCoordinator.py @@ -36,9 +36,10 @@ PROTOCOL_VERSION = 1 -# Review fixes are awaiting repeat qualification. Only isolated or -# mutation-forbidden qualification modules can exercise provisional authority. -_COMMITTED_INDEX_QUALIFIED = False +# Enable native validation after correctness and upgrade qualification. +# Every invocation still requires supported capabilities, verified witnesses, +# complete worker retirement, and successful native-handle cleanup. +_COMMITTED_INDEX_QUALIFIED = True PLAN_HEADER = "protocyte-output-plan-v1" GENERATED_SUFFIXES = (".protocyte.cpp", ".protocyte.hpp", "/runtime.hpp") @@ -1522,7 +1523,7 @@ def _validate_registry( metrics["fallback"] = "reference" if self.registry_validation == "commit-shadow" or index_allowed: if progress is not None: - progress.phase("validating provisional observation commit", "validation") + progress.phase("validating registry", "validation") started = time.perf_counter() try: # Close markers on shared ancestors would otherwise invalidate @@ -1730,7 +1731,7 @@ def _preview_committed_index( metrics["commit_claims_checked"] += 1 if progress is not None: progress.registry(claim=True) - progress.phase(f"provisional observation commit ({metrics['commit_claims_checked']} claims)", "validation") + progress.phase(f"validating registry ({metrics['commit_claims_checked']} claims)", "validation") queries = [ (plan.root, scope.path_key(plan.root), plan.build_id, tuple((target.identity, target.staging) for target in plan.targets)) diff --git a/cmake/ProtocyteOwnershipIndex.py b/cmake/ProtocyteOwnershipIndex.py index c26b609..22097b0 100644 --- a/cmake/ProtocyteOwnershipIndex.py +++ b/cmake/ProtocyteOwnershipIndex.py @@ -1,8 +1,7 @@ -"""Experimental ownership geometry, with no mutation or filesystem authority. +"""Ownership geometry, with no mutation or filesystem authority. -An index describes sampled observations only. It cannot authorize reconciliation -or publication. The coordinator's shadow mode always runs its fresh reference -validator after the preview, and fails closed on disagreement. +The observing caller must authenticate records and verify the observation +scope before using this geometry to authorize reconciliation or publication. """ from __future__ import annotations diff --git a/cmake/ProtocytePathObservation.py b/cmake/ProtocytePathObservation.py index 1aa9d40..456f77d 100644 --- a/cmake/ProtocytePathObservation.py +++ b/cmake/ProtocytePathObservation.py @@ -1,9 +1,9 @@ -"""Experimental fresh Windows path observations, never an operation-wide lease. +"""Fresh Windows path operations, never an operation-wide lease. Each projection opens the entire existing path with OBJ_DONT_REPARSE, reads that handle and closes it before returning. No filesystem facts are cached. Missing components are searched again on every call. This module grants no ownership or -mutation authority; the coordinator uses it only behind reference verification. +mutation authority; the coordinator verifies the observation scope separately. """ from __future__ import annotations diff --git a/docs/consumer-validation-results.json b/docs/consumer-validation-results.json deleted file mode 100644 index 5ee262c..0000000 --- a/docs/consumer-validation-results.json +++ /dev/null @@ -1,2206 +0,0 @@ -{ - "date": "2026-11-16", - "branch": "codex/experimental-generation-engine", - "starting_commit": "0fe8ad4", - "privacy": "anonymous retained consumer; no raw manifest, path, token, output name, ledger, journal name, or log is published", - "promotion": { - "required_all_validation_seconds": 30, - "reliable_under_30_seconds": false, - "decision": "do not promote", - "default": "reference", - "production_index_authorization_qualified": false, - "consumer_cli_cannot_enable_index": true, - "qualification_override": "only isolated fixture modules or mutation-forbidden read-only consumer validation" - }, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "git_normalized_implementation_files": { - "ProtocyteOutputCoordinator.py": "78d38996c8c39c38b232142ed8578a663227e10f16c02a8e6bfca4a07c3b52be", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "source_normalization": { - "difference": "CRLF to LF only", - "files": [ - "ProtocyteOutputCoordinator.py" - ], - "all_four_ast_identical": true, - "staged_sources_verified": true - }, - "historical_log": { - "validation_seconds": 751.875, - "lock_wait_seconds": 0.328, - "reconciliation_seconds": 1.969, - "total_seconds": 754.172, - "registry_entries": 2172, - "current_plans": 11, - "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85" - }, - "workload": { - "registry_entries": 2239, - "additional_claims_since_historical_run": 67, - "current_plans": 11, - "targets_per_plan": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 - ], - "declared_outputs": 232, - "ledger_records": 4478, - "ntfs_volumes": 2, - "python": "3.12.9", - "windows_build": 26300, - "original_live_registry_and_locks": true, - "frozen_ledger_matches_first_and_final_capture": true, - "cold_os_cache_claimed": false, - "cache_or_security_settings_changed": false - }, - "reference_oracles": [ - { - "mode": "legacy-reference", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85" - }, - "index_authorization_enabled": false, - "result": "accepted", - "registry_entries": 2239, - "claims_checked": 2239, - "validation_seconds": 785.3106262999936, - "validation_cpu_seconds": 605.984375, - "frozen_ledger": true, - "original_output_paths": true, - "original_namespace_checked_separately": true, - "live_shared_lock_held": false, - "ownership_or_output_mutations": 0 - }, - { - "mode": "reference", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "index_authorization_enabled": false, - "result": "accepted", - "registry_entries": 2239, - "claims_checked": 2239, - "validation_seconds": 595.7590653999941, - "validation_cpu_seconds": 445.328125, - "frozen_ledger": true, - "original_output_paths": true, - "original_namespace_checked_separately": true, - "live_shared_lock_held": false, - "ownership_or_output_mutations": 0 - } - ], - "initial_strict_candidates": [ - { - "mode": "candidate", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 17.61311289999867, - "validation_cpu_seconds": 15.453125, - "plan_parse_seconds": 0.09259309998014942, - "lock_wait_seconds": 0.247461499995552, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "consumer-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 718656, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979 - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "candidate", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 17.446612500061747, - "validation_cpu_seconds": 15.28125, - "plan_parse_seconds": 0.09272740001324564, - "lock_wait_seconds": 0.15991239994764328, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "consumer-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719056, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979 - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "candidate", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 17.31433070008643, - "validation_cpu_seconds": 15.546875, - "plan_parse_seconds": 0.11862260004272684, - "lock_wait_seconds": 0.22342150000622496, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "consumer-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 718736, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979 - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "candidate", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 16.887565499986522, - "validation_cpu_seconds": 15.0, - "plan_parse_seconds": 0.08406679995823652, - "lock_wait_seconds": 0.1682880000444129, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "consumer-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 718816, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979 - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "candidate", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 16.806976999971084, - "validation_cpu_seconds": 14.859375, - "plan_parse_seconds": 0.09498679998796433, - "lock_wait_seconds": 0.18852690001949668, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "consumer-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 718976, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979 - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - } - ], - "first_live_strict_candidate": { - "scope": "anonymous original consumer configuration; original live namespace; no reconciliation authority", - "mode": "read-only-candidate", - "current_plans": 11, - "target_counts": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 - ], - "output_count": 232, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "plan_parse_seconds": 0.1472698000143282, - "index_authorization_enabled": false, - "lock_wait_seconds": 0.2867827999871224, - "registry_entries": 2239, - "result": "accepted", - "validation_seconds": 25.715632600011304, - "validation_cpu_seconds": 21.265625, - "native_metrics": { - "mode": "consumer-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 720736, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979 - }, - "claims_and_plans_unchanged": true, - "tokens_produced": 0, - "reconciliation_authorized": false - }, - "integrated_gate": { - "scope": "entire production validation entry point, parsing and plan-set checks included; no reference pass, reconciliation, tokens or output writes", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "samples": [ - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 26.174323499959428, - "validation_cpu_seconds": 20.78125, - "plan_parse_seconds": 0.11409639997873455, - "lock_wait_seconds": 0.3012814000248909, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 25.34356820001267, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 720336, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 35.603824500052724, - "validation_cpu_seconds": 28.03125, - "plan_parse_seconds": 0.08776360005140305, - "lock_wait_seconds": 0.26508110004942864, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 34.69687200000044, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 728816, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 39.80337069998495, - "validation_cpu_seconds": 30.5625, - "plan_parse_seconds": 0.11223809997318313, - "lock_wait_seconds": 0.5415107000153512, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 37.12091679999139, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 721136, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 36.97771129995817, - "validation_cpu_seconds": 30.28125, - "plan_parse_seconds": 0.15987639996455982, - "lock_wait_seconds": 0.4058109000325203, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 35.323619100032374, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 720176, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 40.635606099967845, - "validation_cpu_seconds": 31.46875, - "plan_parse_seconds": 0.20475819997955114, - "lock_wait_seconds": 0.38760140002705157, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 38.474822300020605, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 728496, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 41.542352200020105, - "validation_cpu_seconds": 31.265625, - "plan_parse_seconds": 0.14437210001051426, - "lock_wait_seconds": 0.29777459998149425, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 40.36508209997555, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 729456, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 31.042304800008424, - "validation_cpu_seconds": 25.015625, - "plan_parse_seconds": 0.1883442000253126, - "lock_wait_seconds": 0.46938560000853613, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 29.291116799984593, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 720336, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 27.057863000023644, - "validation_cpu_seconds": 21.34375, - "plan_parse_seconds": 0.1810702999937348, - "lock_wait_seconds": 0.30401149997487664, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 25.882735699997284, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719776, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 27.432832800026517, - "validation_cpu_seconds": 21.234375, - "plan_parse_seconds": 0.24761989997932687, - "lock_wait_seconds": 0.3651012000045739, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 26.08510019996902, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 722096, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 25.667929299990647, - "validation_cpu_seconds": 20.78125, - "plan_parse_seconds": 0.2507786999922246, - "lock_wait_seconds": 0.2669615999911912, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 24.369054599956144, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719376, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - } - ], - "all_validation_seconds": [ - 26.174323499959428, - 35.603824500052724, - 39.80337069998495, - 36.97771129995817, - 40.635606099967845, - 41.542352200020105, - 31.042304800008424, - 27.057863000023644, - 27.432832800026517, - 25.667929299990647 - ], - "minimum_seconds": 25.667929299990647, - "median_seconds": 33.323064650030574, - "maximum_seconds": 41.542352200020105, - "under_30_seconds": 4, - "over_or_equal_30_seconds": 6, - "speedup_vs_751_875_median": 22.563200830908876, - "reduction_vs_751_875_median_percent": 95.56800470157532, - "speedup_vs_751_875_worst": 18.098999218432223, - "speedup_vs_700_median": 21.006471264021563, - "reduction_vs_700_median_percent": 95.23956219285277 - }, - "final_guarded_read_only_smoke_samples": [ - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 25.793771799944807, - "validation_cpu_seconds": 20.4375, - "plan_parse_seconds": 0.10730999999213964, - "lock_wait_seconds": 0.1914585000486113, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 24.998205800016876, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 718896, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 22.101702600019053, - "validation_cpu_seconds": 18.171875, - "plan_parse_seconds": 0.2061614000122063, - "lock_wait_seconds": 0.29463449999457225, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 20.858484099968337, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 720496, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "qualification_driver_sha256": "0bdf79601ec461097ef7dd6fd4059d618af60e6c8767b17168c65fc479c7d3b2", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 25.056636399938725, - "validation_cpu_seconds": 20.671875, - "plan_parse_seconds": 0.10060959996189922, - "lock_wait_seconds": 0.18200520001119003, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 24.17838270001812, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719296, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - } - ], - "unqualified_parallel_experiment": { - "production_scheduling_changed": false, - "workers": 4, - "trials": [ - { - "prototype": "parallel negative comparisons; production source unchanged; mutation forbidden", - "workers": 4, - "prototype_sha256": "219b5f5285a6b0f26bfe3ee55ba4b181fbdf3ad5ce296d3fa45aca85af314f7f", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "result": "accepted", - "validation_seconds": 24.28378179995343, - "validation_cpu_seconds": 28.609375, - "plan_parse_seconds": 0.10794779995921999, - "lock_wait_seconds": 0.2210819000029005, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 23.405751799989957, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 721776, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "prototype": "parallel negative comparisons; production source unchanged; mutation forbidden", - "workers": 4, - "prototype_sha256": "219b5f5285a6b0f26bfe3ee55ba4b181fbdf3ad5ce296d3fa45aca85af314f7f", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "result": "accepted", - "validation_seconds": 16.79476949997479, - "validation_cpu_seconds": 22.265625, - "plan_parse_seconds": 0.07279780000681058, - "lock_wait_seconds": 0.1466507000150159, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 16.17461909999838, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719376, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - } - ], - "paired_serial": { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "qualification_driver_sha256": "e959178ea2880fdf0661db18be384aba23ae6ef1386e630ebf80a6308220d40b", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 21.647801499988418, - "validation_cpu_seconds": 18.5, - "plan_parse_seconds": 0.098663899989333, - "lock_wait_seconds": 0.21336120000341907, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 20.880577100033406, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 718496, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - "limitation": "Private read-only prototype only; not promoted, not a ten-run gate, and not a substitute for worker teardown, exception, metric synchronization and platform qualification." - }, - "final_smoke_does_not_reset_failed_gate": "No performance optimization changed the native helper after the ten-run gate; quiet smoke samples verify the closed promotion guard and read-only override only.", - "profile": { - "separate_from_unprofiled_gate": true, - "receipt": { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 29.81850430002669, - "validation_cpu_seconds": 25.40625, - "plan_parse_seconds": 0.109815800038632, - "lock_wait_seconds": 0.26832329999888316, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 28.773140899953432, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719136, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - "profiler_total_seconds": 30.201925199999994, - "negative_probe_calls": 261703, - "negative_probe_internal_seconds": 15.791406, - "negative_probe_cumulative_seconds": 15.8716688, - "fraction_of_profile_total": 0.5228609068934454 - }, - "preservation_audits": [ - { - "mode": "audit", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "e5dc6029439a6d3e2370bc83b06430d31b0433dfed1b454e724e4841340bffc6", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "index_authorization_enabled": false, - "registry_entries": 2239, - "committed_output_files_checked": 232, - "claims_plans_snapshots_outputs_and_mtimes_unchanged": true, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "audit", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "qualification_driver_sha256": "0bdf79601ec461097ef7dd6fd4059d618af60e6c8767b17168c65fc479c7d3b2", - "index_authorization_enabled": false, - "registry_entries": 2239, - "committed_output_files_checked": 232, - "claims_plans_snapshots_outputs_and_mtimes_unchanged": true, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "audit", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "qualification_driver_sha256": "e959178ea2880fdf0661db18be384aba23ae6ef1386e630ebf80a6308220d40b", - "index_authorization_enabled": false, - "registry_entries": 2239, - "committed_output_files_checked": 232, - "claims_plans_snapshots_outputs_and_mtimes_unchanged": true, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "audit", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "qualification_driver_sha256": "e959178ea2880fdf0661db18be384aba23ae6ef1386e630ebf80a6308220d40b", - "index_authorization_enabled": false, - "registry_entries": 2239, - "committed_output_files_checked": 232, - "claims_plans_snapshots_outputs_and_mtimes_unchanged": true, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - } - ], - "upgrade": { - "scope": "isolated Windows cross-version checks; no consumer registry accessed", - "legacy_git_blob": "25f1660190d3d1015fef3955814c8c737bd686c5", - "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", - "candidate_coordinator_sha256": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "700b35bb01dde4cd698673ece321fd066630cf27ea335aeeafcdbf167dc3199b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "candidate_helper_sha256": { - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583" - }, - "unchanged_ast_methods_since_checkpoint": [ - "reconcile_set", - "_reconcile_locked", - "validate", - "publish", - "reset", - "_recover", - "_apply_pending", - "_publish_one", - "_initialize_claim_locked", - "_release_claim", - "_generation_lock", - "_publication_lock" - ], - "reference_validator_ast_unchanged_since_checkpoint": false, - "file_lock_ast_unchanged_since_checkpoint": true, - "passed_cases": 91, - "production_index_authorization_qualified": false, - "index_authority_enabled_only_in_isolated_fixture_module": true, - "indexed_validations": 16, - "index_authorized_validations": 15, - "indexed_reference_fallbacks": 1, - "cases": [ - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "reference", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "reference", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "shadow", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "native-shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "native-shadow", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "commit-shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "commit-shadow", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "indexed", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "indexed", - "reader": "old", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - } - ] - }, - "unchanged_ast_methods_since_starting_commit": [ - "reconcile_set", - "_reconcile_locked", - "validate", - "publish", - "reset", - "_recover", - "_apply_pending", - "_publish_one", - "_initialize_claim_locked", - "_release_claim", - "_generation_lock", - "_publication_lock", - "_validate_registry_reference" - ], - "verification": { - "python_314_full_suite": { - "passed": 1863, - "skipped": 41 - }, - "python_312_targeted_suite": { - "passed": 137 - }, - "guarded_indexed_coordinator_suite": { - "passed": 89, - "skipped": 6 - }, - "cmake_before_final_guard": { - "passed": 21, - "skipped": 1 - }, - "relocated_install_after_final_guard": { - "passed": 5 - }, - "cross_version_cases": 91, - "no_cpp_files_edited": true - }, - "verification_notes": [ - "Three backend-specific fault injections were extended to the native backend; all indexed coordinator tests then passed.", - "An existing formatter test failed its 0.5-second grandchild startup assumption. Its fixture now gives startup margin and releases descendants after timeout while preserving the process-tree termination assertion; two targeted reruns and two complete suites passed afterward.", - "One extra smoke trial was discarded when a driver fingerprint changed during an edit. A replacement trial completed with frozen sources; discarded timing is not included." - ], - "limits": [ - "ten-run timing gate failed in six samples; normal consumers retain reference validation", - "warm/reused OS cache and inputs; no cold-cache guarantee", - "long original and branch references ran concurrently on frozen ledger copies with real geometry and separate original namespace checks; timings are descriptive", - "native semantics qualified on one Windows/NTFS host, not every filter or Windows version", - "ordinary cooperative registry writer model and fresh mutation-time guards remain required", - "unknown, dirty, missing, trimmed or over-budget witnesses require reference fallback" - ] -} diff --git a/docs/consumer-validation-results.md b/docs/consumer-validation-results.md deleted file mode 100644 index 074878e..0000000 --- a/docs/consumer-validation-results.md +++ /dev/null @@ -1,171 +0,0 @@ -# Retained consumer qualification - -Historical serial qualification at `8851bde`. Its failed timing gate and source -fingerprints are preserved here. The subsequent -[parallel-probe qualification](parallel-probe-results.md) passed the gate and -documents the initial enablement. The subsequent [MR review](mr55-review-results.md) -closed promotion after a repeat timing failure and records the current default. - -This report uses an anonymous retained consumer configuration, not a synthetic -replacement. Raw manifests, logs, claim tokens, ledger copies, paths, and output -names stay in ignored local evidence. **Promotion failed:** six of ten complete -integrated validations exceeded 30 seconds. The default remains reference, and -an explicit source guard prevents consumer commands or the private API from -granting index authority. The success path is exercised only in isolated tests -or the mutation-forbidden read-only qualification harness. - -## Workload identity and scope - -The retained configure log contains the exact original measurement: -**751.875 seconds validation**, 0.328 seconds lock wait, 1.969 seconds -reconciliation, and 754.172 seconds total. It identifies 2,172 registry claims -and 11 current plans. The cached coordinator's SHA-256 is -`2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85`, -matching the pinned public source used by the upgrade qualification. - -The same configuration still has 11 current plans, one target each, and 232 -declared generated files. The shared v1 registry now contains **2,239 claims**, -67 more than the historical run, and **4,478 claim/plan records**. The extra -records are retained and checked. No registry was reset, pruned, split, or -replaced. Measurements use CPython 3.12.9 on Windows, with native observations -on two NTFS volumes. - -Two distinct read-only procedures keep the live consumer usable: - -- Candidate and integrated indexed validation acquire the original registry, - generation, and publication locks in their original order and validate the - complete live registry against the original current plans. -- Slow reference oracles operate on byte-identical ledger copies captured under - those locks. Their claim payloads still refer to the real output, build, and - staging paths. Each oracle also executes the original lock-namespace checks - separately. The full copied-ledger pass filters no foreign records. It does - not hold the shared consumer lock for several minutes. - -The helper rejects ownership/output mutation attempts. It never reconciles, -publishes, resets, produces a claim token, or changes production defaults. A -separate preservation audit checks original claim/plan bytes, current snapshots, -generated file hashes, and generated file mtimes. -Source roots, states, and record files must be ordinary non-reparse objects; -capture rejects unsafe source topology rather than copying it into a clean tree. -Native validation posts the counted USN metadata witnesses described in the -contract; read-only here refers to ownership records and generated content. - -## Final integration decision - -The ten fresh-process integrated samples were **26.174, 35.604, 39.803, 36.978, -40.636, 41.542, 31.042, 27.058, 27.433, and 25.668 seconds**. All accepted the -same complete live ledger with verified end witnesses, no reference pass, and -balanced handles. Only **4/10** were below 30 seconds. The median was -**33.323 seconds**, and the worst was **41.542 seconds**. - -Relative to the exact historical 751.875-second measurement, the median is -**22.56 times faster (95.57% less time)** and the worst is 18.10 times faster. -Relative to an approximate 700-second baseline, the median is 21.01 times faster -(95.24% less time). These are descriptive comparisons across different runs, -not controlled claims about the algorithm alone. They describe the proposed -indexed path, not a speedup delivered by the unchanged reference default. - -One separate cProfile run attributed **15.791 of 30.202 profiled seconds** to -the **261,703 fresh negative probes**. Each unprofiled gate sample retained -84,579 fresh reservation comparisons, two full registry inventories, 17,958 -close posts, 8,979 exact end witnesses, and all 26,916 handle closes. Alternate -fresh root-relative lookup microbenchmarks did not establish enough improvement -to close the observed timing gap reliably; no alternate API was shipped. -Caching negative results would remove a correctness check and remains rejected. - -A separate read-only prototype scheduled independent fresh comparisons on four -workers, joining them before seal or handle release. It preserved all 261,703 -negative probes and verified every witness. Its two runs took **24.284 and -16.795 seconds**; the paired serial run took **21.648 seconds**. The second -parallel run used **22.266 CPU seconds**, versus 18.500 for the paired serial -run. This is promising feasibility evidence, with additional CPU cost, not a -completed reliability or concurrency qualification. Production scheduling was -not changed. Worker teardown, exceptional exits, counter synchronization, and -the complete timing gate need evidence before adopting it. - -After the failed series, the final source added the closed promotion guard. -Extra guarded read-only smoke samples check that prototype path and the final -preservation audit. No performance change follows the failed series: the native -helper is byte-identical. Those quieter samples do not reset the failed timing -history or justify enabling the index. Full per-run metrics, exact as-run and -Git-normalized source fingerprints, and preservation receipts are retained in -[the anonymous JSON report](consumer-validation-results.json). - -## Completed reference and candidate checks - -| Measurement | Validation wall time | Result | -| --- | ---: | --- | -| Historical original consumer log, 2,172 claims | 751.875 s | Accepted | -| Exact original source, frozen 2,239-claim ledger | 785.311 s | Accepted | -| Branch reference validator, same frozen ledger | 595.759 s | Accepted | -| First strict native candidate, live 2,239-claim ledger | 25.716 s | Verified, accepted | -| Five subsequent fresh-process strict candidates, live ledger | 17.613, 17.447, 17.314, 16.888, 16.807 s | All verified, accepted | - -The two long reference measurements overlapped; their timings describe those -runs rather than a controlled speed comparison. Their purpose is complete -oracle agreement on the retained workload. The candidate times include current -plan parsing, current-plan set checks, all record authentication, index -construction, fresh missing-path comparisons, final inventories and bindings, -USN versions, exact end witnesses, and handle release. Lock wait is separate. -They exclude reconciliation and an additional reference pass. - -These initial runs precede the final observer coordination and duplicate-volume -hardening. Their exact source fingerprints remain in the machine-readable -report. They are feasibility evidence, not final-source promotion evidence. -Each invocation builds a new read set and reauthenticates every record. The -workload and OS caches are reused; no cold-cache claim is made and no cache or -security setting was changed. - -## Correctness and upgrade boundaries - -The [observation contract](observation-commit-contract.md) explains which native -facts are certified. Existing positive paths require exact canonical spelling; -missing paths are freshly checked in both comparison directions and at seal. -Relevant mutations must change the saved version or make the exact forced end -record dirty. Native tests inject rename, record-content, and attribute-only -reparse ABA changes after the last version read, verifying that end witnesses -close that gap. Tests retain the unjournaled case-mode counterexample. - -When enabled only inside qualification, the integrated path can return index -authority only after a verified seal and complete handle release. Incomplete -or inconsistent metrics grant no authority. -Conflicts and unavailable, changed, malformed, or over-budget observations run -the reference validator, preserving its diagnostics. Abandoned state uses the -reference cleanup path. A per-user observer mutex prevents independent new -observers from invalidating common-ancestor markers; it is released before -reference fallback and never replaces the existing ownership locks. Duplicate -volume serials reached through another drive binding force fallback. - -No facts cross into initialization, recovery, publication, reset, or another -invocation. Those mutation methods and the ownership locks remain unchanged. -Protocol v1, record encodings, tokens, and recovery formats need no migration. -The independent recorded-plan metadata fix rejects dangling links and metadata -errors instead of silently skipping retained state; valid users need no reset. - -## Reproduction and privacy - -Verification passed: **1,863 default tests** (41 platform/capability skips), -**137 minimum-Python checks**, **89 indexed coordinator tests** (6 platform -skips), **91 old/new upgrade and crash-recovery cases**, and **21 CMake checks** -(1 platform skip), followed by **5 final-source relocated-install checks**. -The latter include default operation and rejection of the unqualified index -flag. Upgrade fixtures exercised 15 native acceptances and one recovery-state -fallback. A formatter test's reproduced startup assumption was replaced with -startup margin and a descendant release handshake, retaining its timeout and -tree-termination assertions; the complete suite passed afterward. - -Use [the qualification helper](../tests/verify_consumer_registry.py) with a -private JSON manifest containing `registry`, `current_plans`, empty -`retired_plans`, and `legacy_coordinator` paths. Run `capture` into a new private -work directory, then `candidate`, `indexed`, `reference`, `legacy-reference`, -and `audit` as needed. The indexed mode exercises the production validation -entry point and requires index authority with no reference pass. -It overrides the closed promotion guard only in its own imported module, after -disabling all reconciliation, recovery, publication, reset, and mutation entry -points. A failed candidate aborts the live trial rather than blocking the -consumer for a slow reference pass; full reference fallback is checked separately. - -Publish only sanitized `*-results.json` receipts. `preservation.private.json`, -`ledger/`, `inputs/`, raw logs, and the manifest contain private data and must -remain local. The frozen-reference tests verify both original-namespace and -foreign-staging rejection so copying the ledger cannot omit those checks. diff --git a/docs/experimental-index-contract.md b/docs/experimental-index-contract.md deleted file mode 100644 index 5d03d5b..0000000 --- a/docs/experimental-index-contract.md +++ /dev/null @@ -1,89 +0,0 @@ -# Experimental ownership-index contract - -This records the first sampled-index experiment. For the reviewed parallel -observation mechanism and closed promotion guard, see the -[observation contract](observation-commit-contract.md) and -[MR review](mr55-review-results.md). - -Branch: `codex/experimental-generation-engine`, based on preservation checkpoint -`f804fd1` (`codex/issue-54-registry-scaling`). No remote publication is involved. - -## First experiment - -Implement a portable, filesystem-independent ownership index and bounded sampled -geometry/record authentication behind the existing coordinator entry point. -Initially expose **reference** and **shadow** validation only. The default remains -reference. There is no index-only authorization mode. - -In shadow mode: - -1. Sample and authenticate all records, collect geometry and compute an indexed - preview under the existing registry/generation/publication locks. -2. Discard the sampled index as an authority. Always run the original fresh - registry validator, preserving its comparison order and filesystem checks. -3. Propagate every reference rejection. If the preview rejected a case the - reference accepted, fail before claim initialization or output reconciliation. -4. Publish only path-free diagnostic counts, phase timings and agreement status. - Preview timing is not complete validation timing. Full timings include the - mandatory reference pass, even when that means the experiment is slower. - -The preview never deletes abandoned initialization directories, initializes a -claim, resets ownership or writes generated payloads. Reference reconciliation -retains all mutation/recovery authority. A read-only large preview may be measured -separately, but it must be labeled as an unverified algorithm phase, not as an -under-30-second reconciler. - -## Why a sampled index is not yet authoritative - -An immutable record under the registry lock does not imply immutable filesystem -topology. A foreign missing path can become a link between observations; an -ancestor or physical binding can change and return to its old state. A matching -second metadata sweep is not proof of uninterrupted validity. - -Windows native mechanisms were reviewed before implementation: - -- [CreateFile sharing rules](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew) - can constrain deletion/rename and data-write opens, but attribute access has - distinct rules. An open directory handle is not proof that missing children - cannot appear or that every name-to-object relationship remains unchanged. -- [Directory oplocks](https://learn.microsoft.com/en-us/windows/win32/api/winioctl/ni-winioctl-fsctl_request_oplock) - provide cache invalidation notifications, but changes to enumeration contents - can cause advisory breaks without waiting for acknowledgment. They must not be - treated as an unconditional filesystem write barrier. - -No native guard or watcher will be used as mutation authority without a reviewed -consistency argument and adversarial tests covering its exact semantics. The -current experiment instead has a simple safety argument: every successful -operation still passes the existing fresh validator before any reconciliation -mutation. The preview can add a fail-closed rejection but cannot bypass one. - -## Acceptance and stop boundary - -- Pure geometry index results match an exhaustive predicate across lexical, - physical, missing-ancestor, prefix-boundary and ownership/retirement cases. -- Reference mode retains existing test behavior and its original observations. -- Real mutations between preview and reference, including foreign-path changes, - are rejected by the reference path before new claims are initialized. -- Shadow false positives fail closed; shadow false negatives never bypass the - reference failure. Every retained record participates in both relevant phases. -- Benchmarks identify the requested/effective mode, preview/reference durations, - implementation fingerprints and total filesystem work truthfully. - -The first milestone is a reviewable experimental index with differential and -adversarial evidence. Promotion to authoritative indexed validation, packaging -refactoring and the public generation CLI remain gated on the filesystem-lifetime -proof. Correctness takes precedence over meeting a timing threshold. - -## Follow-up observation experiment - -The [fresh observation experiment](observation-mechanism-results.md) adds a -private `native-shadow` mode. It retains reference authority and adds no indexed -authorization mode. A real attribute-only reparse conversion disproved ordinary -read-handle pinning as a path-lifetime proof. The fresh reader's pilot also failed -the performance gate. The original cached-index promotion boundary remains closed. - -The next experiment uses an optimistic read-set commit with exact USN close -witnesses and fresh negative comparisons. Its -[contract and remaining proof boundaries](observation-commit-contract.md) and -[measurements and upgrade evidence](observation-commit-results.md) preserve that -boundary: reference validation remains mandatory and the default is unchanged. diff --git a/docs/experimental-index-results.json b/docs/experimental-index-results.json deleted file mode 100644 index 05952a2..0000000 --- a/docs/experimental-index-results.json +++ /dev/null @@ -1,259 +0,0 @@ -{ - "schema_version": 1, - "status": "experimental shadow index; safe under-30-second target NOT achieved", - "preservation_commit": "f804fd1", - "branch": "codex/experimental-generation-engine", - "default_validation": "reference", - "index_only_authorization_available": false, - "notes": [ - "Fresh explicit synthetic fixtures only; no consumer/shared registry accessed.", - "Setup uses real locked initialization/reconciliation helpers; it is excluded from measured validation.", - "Preview measurements are read-only and non-authoritative; full shadow measurements retain the fresh reference pass.", - "All published measurements match the recorded final coordinator/helper source fingerprints.", - "Timings include instrumentation and uncontrolled workstation/cache effects; fresh process does not imply cold OS cache.", - "Equal claim/plan counts do not establish consumer-equivalent filesystem geometry.", - "Total preview projections add fresh JSON-loader projections to sampled geometry projections; they are an operation-count inference.", - "Earlier pilot measurements and a sample affected by source edits are excluded." - ], - "verification": { - "default_python_regression": { - "command": "python -m pytest -q -n 4", - "result": "passed" - }, - "cmake_integration": { - "passed": 17, - "skipped": 1 - }, - "shadow_coordinator": { - "passed": 87, - "skipped": 6 - }, - "python_312_coordinator_and_index": { - "passed": 113, - "skipped": 6 - }, - "new_index_tests": 26 - }, - "measurements": { - "preview_256": { - "scope": "read-only sampled algorithm; NOT reference verified or authorized", - "reference_validation_performed": false, - "reconciliation_authorized": false, - "tokens_produced": 0, - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "c5df9de17a3c5f5f715ffd8c0944eb45444450113a4fa529139b7cdb31f1efb2", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38" - }, - "timings_include_instrumentation": true, - "retained_claims": 256, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "setup_wall_seconds": 38.34785110002849, - "setup_cpu_seconds": 20.640625, - "lock_preparation_and_wait_seconds": 0.45253629999933764, - "current_plan_validation_seconds": 1.361329699982889, - "preview_wall_seconds": 3.3018979000044055, - "preview_cpu_seconds": 2.71875, - "preview_filesystem_calls": { - "nt.stat": 24174, - "nt.lstat": 1841, - "nt._getfinalpathname": 2612 - }, - "index_experiment": { - "mode": "preview-only", - "authoritative": "none", - "preview_claims": 256, - "preview_records_read": 512, - "preview_unclaimed_states": 0, - "indexed_reservations": 512, - "index_queries": 22, - "sampled_geometry_projections": 794, - "sampled_directory_observations": 538 - }, - "total_preview_path_projections_inferred": 1306 - }, - "preview_2172": { - "scope": "read-only sampled algorithm; NOT reference verified or authorized", - "reference_validation_performed": false, - "reconciliation_authorized": false, - "tokens_produced": 0, - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "c5df9de17a3c5f5f715ffd8c0944eb45444450113a4fa529139b7cdb31f1efb2", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38" - }, - "timings_include_instrumentation": true, - "retained_claims": 2172, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "setup_wall_seconds": 372.5879960000166, - "setup_cpu_seconds": 186.453125, - "lock_preparation_and_wait_seconds": 0.6658470000256784, - "current_plan_validation_seconds": 1.1836236999952234, - "preview_wall_seconds": 28.48035039997194, - "preview_cpu_seconds": 22.3125, - "preview_filesystem_calls": { - "nt.stat": 200446, - "nt.lstat": 15253, - "nt._getfinalpathname": 21772 - }, - "index_experiment": { - "mode": "preview-only", - "authoritative": "none", - "preview_claims": 2172, - "preview_records_read": 4344, - "preview_unclaimed_states": 0, - "indexed_reservations": 4344, - "index_queries": 22, - "sampled_geometry_projections": 6542, - "sampled_directory_observations": 4370 - }, - "total_preview_path_projections_inferred": 10886 - }, - "preview_existing_multi": { - "scope": "read-only sampled algorithm; NOT reference verified or authorized", - "reference_validation_performed": false, - "reconciliation_authorized": false, - "tokens_produced": 0, - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "c5df9de17a3c5f5f715ffd8c0944eb45444450113a4fa529139b7cdb31f1efb2", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38" - }, - "timings_include_instrumentation": true, - "retained_claims": 8, - "current_plans": 11, - "layout": { - "targets_per_plan": 3, - "shared_build_root": true, - "existing_directories": true - }, - "setup_wall_seconds": 1.30061920004664, - "setup_cpu_seconds": 0.78125, - "lock_preparation_and_wait_seconds": 0.3847935000085272, - "current_plan_validation_seconds": 2.5029661000007764, - "preview_wall_seconds": 0.2400352000258863, - "preview_cpu_seconds": 0.203125, - "preview_filesystem_calls": { - "nt.stat": 2185, - "nt.lstat": 98, - "nt._getfinalpathname": 194 - }, - "index_experiment": { - "mode": "preview-only", - "authoritative": "none", - "preview_claims": 8, - "preview_records_read": 16, - "preview_unclaimed_states": 0, - "indexed_reservations": 32, - "index_queries": 44, - "sampled_geometry_projections": 81, - "sampled_directory_observations": 80 - }, - "total_preview_path_projections_inferred": 97 - }, - "shadow_existing_multi": { - "platform": "Windows", - "python": "3.12.9", - "timings_include_instrumentation": true, - "setup_method": "private locked initialization/reconciliation (issue #54 POC)", - "coordinator_sha256": { - "candidate": "c5df9de17a3c5f5f715ffd8c0944eb45444450113a4fa529139b7cdb31f1efb2" - }, - "implementation_files": { - "candidate": { - "ProtocyteOutputCoordinator.py": "c5df9de17a3c5f5f715ffd8c0944eb45444450113a4fa529139b7cdb31f1efb2", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38" - } - }, - "samples": [ - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 8, - "current_plans": 11, - "layout": { - "targets_per_plan": 3, - "shared_build_root": true, - "existing_directories": true - }, - "seed_wall_seconds": 1.6187621999997646, - "seed_cpu_seconds": 1.03125, - "validation_wall_seconds": 9.143145899986848, - "validation_cpu_seconds": 7.46875, - "reconcile_wall_seconds": 13.890712999971583, - "reconcile_cpu_seconds": 11.4375, - "lock_wait_wall_seconds": 0.26127159991301596, - "registry_lock_held_wall_seconds": 13.852026400039904, - "current_plan_validation_wall_seconds": 3.316249900031835, - "validation_engine": "shadow", - "index_experiment": { - "mode": "shadow", - "authoritative": "reference", - "preview_wall_seconds": 0.33316159999230877, - "reference_wall_seconds": 8.809812899969984, - "agreement": true, - "preview_claims": 8, - "preview_records_read": 16, - "preview_unclaimed_states": 0, - "indexed_reservations": 32, - "index_queries": 44, - "sampled_geometry_projections": 81, - "sampled_directory_observations": 80, - "preview_result": "accepted", - "reference_result": "accepted" - }, - "shadow_candidate_wall_seconds": 0.33316159999230877, - "reference_validation_wall_seconds": 8.809812899969984, - "registry_validations": 1, - "registry_scans": 2, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 3430, - "path_projections_total": 5872, - "validation_filesystem_calls": { - "nt.stat": 84391, - "nt.lstat": 3432, - "nt._getfinalpathname": 6860 - }, - "completed_plans": 11 - } - ], - "medians": [ - { - "retained_claims": 8, - "current_plans": 11, - "candidate": { - "seed_wall_seconds": 1.6187621999997646, - "seed_cpu_seconds": 1.03125, - "validation_wall_seconds": 9.143145899986848, - "validation_cpu_seconds": 7.46875, - "reconcile_wall_seconds": 13.890712999971583, - "reconcile_cpu_seconds": 11.4375, - "lock_wait_wall_seconds": 0.26127159991301596, - "registry_lock_held_wall_seconds": 13.852026400039904, - "current_plan_validation_wall_seconds": 3.316249900031835, - "shadow_candidate_wall_seconds": 0.33316159999230877, - "reference_validation_wall_seconds": 8.809812899969984, - "registry_validations": 1, - "registry_scans": 2, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 3430, - "path_projections_total": 5872 - } - } - ] - } - } -} diff --git a/docs/experimental-index-results.md b/docs/experimental-index-results.md deleted file mode 100644 index 8f3a820..0000000 --- a/docs/experimental-index-results.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ownership-index experiment - -Subsequent work: [fresh observation experiment and handle-lease counterexample](observation-mechanism-results.md). -The measurements below retain their original implementation fingerprints; they -have not been relabeled as current-source performance or authoritative validation. - -The experiment is on `codex/experimental-generation-engine`, directly above -preservation commit `f804fd1` on `codex/issue-54-registry-scaling`. The preceding -work was committed before branching; no remote publication or consumer-registry -maintenance was performed. - -## Result and limit - -At **2,172 retained claims and 11 current plans**, the read-only sampled index -took **28.480 s**, with another **1.184 s** for ordinary current-plan validation: -**29.664 s** combined. It read all **4,344 claim/plan records** and indexed all -**4,344 root/staging reservations**. Setup took **372.588 s** separately; lock -preparation/acquisition took **0.666 s** separately. - -This is an algorithm-phase result, **not a safe under-30-second reconciler**. -That run did not execute the fresh registry reference pass after setup, authorize -reconciliation or produce claim tokens. The reported 751.875-second consumer -observation was not rerun, and equal claim/plan counts do not calibrate the -synthetic filesystem layout to the consumer workload. - -The only executable validation modes remain `reference` (default) and `shadow`. -Shadow always performs the fresh reference pass before proceeding, and fails -closed on disagreement. Thus the deployed/default behavior has no claimed -large-case speedup from this experiment, and shadow adds measurement work. - -## Implementation - -- A pure Python index retrieves possible conflicts using lexical prefixes and - physical endpoint/ancestor keys, including normalized missing suffixes. It - preserves ownership and retirement exemptions and performs no filesystem I/O. -- One scoped preview authenticates retained records and collects bounded sampled - geometry. Samples are discarded when the preview ends. They cannot authorize - initialization, reconciliation, retirement or publication. -- Shadow runs behind the existing coordinator entry point and lock order. Every - reference rejection is preserved; preview failure cannot grant authority. - Diagnostics contain counts, timings and agreement, without private paths. -- The optional helper installs beside the coordinator. An actual installed, - relocated-prefix test exercises shadow mode and verifies that the entire - package prefix remains unchanged, including absence of bytecode-cache writes. -- Full benchmark/POC shadow modes retain all checks. A separate read-only tool - labels its unverified scope explicitly. Measurements fingerprint both source - files and reject a run if either changes while it is being measured. - -Existing CMake helpers and normal installation/build commands require no new -configuration. The broader Python packaging and public generation CLI changes -remain a later stage of [the engine proposal](generation-engine-proposal.md). - -## Work counts and measurements - -The exact-size preview made **6,542 sampled geometry projections** and **4,370 -directory observations**, then answered **22 index queries**. Geometry projections -exclude the original JSON-loader path checks. Including the two fresh JSON-path -projections per claim gives **10,886 total projections** for this fixture. -Compare that with the prior reference operation-count inference of **254,257** -for this shape: about **23.4 times fewer projections**, not a measured end-to-end -wall-time ratio. There were still **200,446 `stat`**, **15,253 `lstat`**, and -**21,772 final-path** calls in the preview, so filesystem work remains substantial. - -A full shadow sample with eight retained claims, eleven current plans, three -targets per plan, existing root/staging directories and one shared build root -accepted in both phases. It checked 16 records in each phase and indexed 32 -reservations. The sampled phase took **0.333 s**, fresh registry reference -validation **8.810 s**, and current-plan validation **3.316 s**. Full -reconciliation took **13.891 s**, including locks and output-state reconciliation. -Those costs have not been hidden in the preview number. - -The sanitized source fingerprints, complete phase metrics, 256-claim scaling -sample and anonymous layout variants are in -[experimental-index-results.json](experimental-index-results.json). Measurements -used CPython 3.12.9 on Windows, include instrumentation, and are individual -workstation samples. A fresh fixture/process does not imply a cold OS cache. -The exact-size run leaves essentially no margin for a safe lifetime mechanism -or slower layouts; it also misses the proposed 25-second research budget. - -## Correctness evidence - -- The full default Python regression suite passed, followed by **17 passed, - 1 skipped** CMake integration tests. -- The existing coordinator suite in shadow mode passed: **87 passed, 6 skipped**. -- Python 3.12 coordinator/index compatibility checks passed: **113 passed, - 6 skipped**. These include 26 new index tests. -- Fixed-seed differential tests compare indexed results to exhaustive geometry - across aliases, missing suffixes and prefix boundaries. Focused tests cover - ownership/retirement exemptions and disjoint-query scaling. -- Injected foreign root, staging and ancestor replacements, plus a simulated - physical alias introduced after sampling, are rejected by fresh reference - validation before new claims are initialized. Injected preview false positives, - false negatives and parser errors cannot authorize a mutation. -- Read-only-preview tests prohibit filesystem mutation, retain abandoned state, - enforce sample expiry and preserve the CLI token protocol. - -These tests establish the safety of retaining reference authority. They do not -prove that sampled topology remains valid or that index-only operation is safe. - -## Upgrade and rollback review - -An additional isolated Windows/CPython 3.12 review used the exact public -[coordinator revision cited in issue #54](https://github.com/anthonyprintup/protocyte/blob/a37bde7156f444a22f7ab9d42392c91adb54ad30/cmake/ProtocyteOutputCoordinator.py). -Its source SHA-256 was verified as -`2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85`. -The experiment's coordinator/helper fingerprints remain unchanged from the -published measurements. - -All **33 additional cases passed**: - -| Case | Count | What was checked | -| --- | ---: | --- | -| Normal upgrade and rollback | 4 | Old/reference/shadow interchange, unchanged claim tokens, plan digests, no-op output bytes/mtimes and successful publication in both versions | -| Publication interrupted at four durable cuts | 12 | Recovery across versions from pending intent, either replaced output and committed snapshot, after deleting original staging payloads | -| Initialization interrupted at two cuts | 6 | Cross-version retry after initial snapshot or visible claim | -| Reset interrupted at three cuts | 9 | Cross-version completion using the existing token and durable reset intent | -| Two actual processes sharing a registry | 2 | Old holds/new waits and new holds/old waits; no claim appears before release, reconciliation completes afterward | - -The crash cases cover old-to-reference, old-to-shadow and shadow-to-old. The -steady-state cases additionally cover reference-to-old. These are tests against -that specific protocol-v1 baseline, not a guarantee for every historical release. -They used only fresh synthetic registries. - -AST comparison with preservation checkpoint `f804fd1` confirmed that the fresh -registry validator, file-lock implementation and twelve mutation/recovery/lock -methods retain their implementation. Protocol v1, plan header, registry namespace, -public CMake calls and generated C++ are unchanged by the experiment. A normal -upgrade should preserve existing build ownership without a state migration or -reset. Reconfigure through the normal build workflow to select the upgraded -package; relocating a build into another ownership identity remains subject to -the existing ownership checks. - -The review also repaired a test fixture: the unowned-file-symlink reset test had -not created its output directory, causing a missing-parent error to be reported -as unavailable symlink support. It now creates the directory, verifies the -external file survives, and only skips recognized permission/unsupported-operation -errors. On this host it still skips for the genuine Windows symlink privilege -restriction. Five other coordinator cases require case-sensitive paths or POSIX -path semantics. Those six cases remain coverage gaps for this host; supported-platform -CI and a suitable Windows symlink environment are still required before release. - -## Promotion gate - -The remaining problem is the filesystem-observation lifetime, described in -[the experimental contract](experimental-index-contract.md). A registry lock -does not prevent foreign paths from changing. A second matching metadata sweep -or a filesystem watcher is insufficient to establish continuous validity. - -Before removing the reference pass, define and review a mechanism that preserves -all relevant name/object/missing-component bindings through the mutation -boundary, with bounded fail-closed recovery. Test its exact race and alias -semantics, then measure **all** its work on the large case and representative -layouts. The fast preview alone provides neither that proof nor enough timing -margin. No index-only authorization switch is provided in this experiment. diff --git a/docs/generation-engine-proposal.md b/docs/generation-engine-proposal.md deleted file mode 100644 index 8c08336..0000000 --- a/docs/generation-engine-proposal.md +++ /dev/null @@ -1,237 +0,0 @@ -# A fast generation engine with simple integration - -## Recommendation and user contract - -Make planning, output ownership and publication a build-system-independent Python -engine. Keep CMake for packaging/exported C++ targets and as a thin, convenient -build adapter. Add a standalone CLI backed by the same engine. - -Ease of use is an acceptance criterion, not a later documentation task: - -- Existing consumers should keep their familiar `protocyte_add_proto_library`, - `protocyte_generate` and descriptor-set helper calls. -- Source/FetchContent users should configure and build without a separate global - plugin install or manual environment activation. -- Installed-prefix users should retain `find_package(protocyte CONFIG REQUIRED)` - and the current runtime targets, including read-only/relocatable prefixes. -- A standalone user should supply schemas and an output location, with managed - state/tool selection handled automatically. Configuration files are optional. -- Users should not select registry partitions, cache modes, lock strategies or - migration flags. Normal upgrades preserve ownership; conflicts remain explicit. - -The proposed standalone command is **new functionality**, not an existing command: - -```console -protocyte generate --proto-root proto --out-dir build/generated -``` - -The ordinary CMake call can remain: - -```cmake -protocyte_add_proto_library( - TARGET application_proto - PROTO_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/proto" - DISCOVER - HOSTED_ALLOCATOR -) -target_link_libraries(application PRIVATE application_proto) -``` - -The CLI may later have optional configuration for repeated complex arguments; -the basic case must not require users to author manifests or inventory files. -Python remains the current prerequisite. This design adds no native helper build, -service, database installation or extra process that users must manage. - -## Architecture and responsibilities - -```mermaid -flowchart LR - C[CMake adapter] --> E[Shared Python generation engine] - L[Standalone CLI] --> E - E --> P[Plan and dependency metadata] - E --> G[Host protoc and Protocyte plugin] - G --> T[Validated staging and transactional publication] - T --> O[Generated C++ outputs] -``` - -Suggested boundaries, introduced only as their contracts become clear: - -| Layer | Responsibility | -| --- | --- | -| Request/planning API | Normalize generation specs, reuse dependency/output naming logic, return task and dependency metadata | -| Record model | Decode/authenticate claims and plans, bind builds/targets, validate snapshots and transaction intent | -| Filesystem layer | Projection, aliases, ordinary-directory checks, missing components, physical identities and observation lifetime | -| Ownership index | All retained root/staging reservations, containment in both directions and existing ownership/retirement exceptions | -| Transaction engine | Locks, staging, durable intent, publication, retirement, recovery and reset | -| Adapters | Public arguments, C++ build targets, depfile/build metadata and presentation | - -Start with Python 3.12 and the existing standard-library-only coordinator code. -The generator already lives in the Python package; the coordinator can become -its build-engine subpackage without bringing protobuf-dependent imports into the -bootstrap/filesystem layer. Existing claims and write-ahead transactions remain -the initial storage/protocol format. A persistent database or daemon is not -necessary to test the indexed algorithm. - -Conceptual internal API: - -```python -prepared = engine.prepare(build_root, generation_specs) -engine.run(prepared.task(target_id)) -``` - -`prepare` batches declarations for the entire build and returns generated task -descriptions, outputs, dependency metadata and ownership binding. `run` performs -fresh task/claim validation, generation into staging and publication. Validation -and ownership-aware reset remain explicit internal entry points. - -Adapters create the task files automatically. They are versioned machine data, -not another configuration language for users. Requests must preserve Unicode, -spaces, semicolons and Windows path spellings without shell-command construction. -Keep the existing path transport until a replacement passes the transport tests. - -The public CLI should have a stable default build identity across invocations, -derived from its build scope rather than a new random owner every time. A build -directory override can be optional. The CMake adapter supplies its binary build -root as it does today. Different adapters must not silently adopt one another's -outputs merely because the requested directory matches. - -## How CMake becomes smaller - -CMake should declare C++ targets, configure dependency edges and invoke the engine. -At configure time it submits one batch of generation specs. At build time it -invokes one engine task for each generation job. The engine handles compiler -response files, staging, task validation and publication in one orchestration -process; the compiler/plugin remain subprocesses as required by their protocol. - -This replaces the current recursive CMake/Python generation wrapper chain. It -also gives other build systems access to the same safe pipeline. Dependency -discovery remains available before CMake must declare outputs, with correct -no-op builds, import-change detection and multi-config behavior. - -The current #52 behavior already batches registry reconciliation. The new adapter -must preserve that and must not call a full `prepare` separately for each target. -Moving orchestration out of CMake simplifies ownership and process flow, but it -does not itself solve the 750-second validation: the standalone Python POC -reproduces that cost without running CMake. - -Do not delete a CMake filesystem check just because similarly named Python code -exists. Map every current guard to its replacement boundary and keep the old -guard until the backend covers its safety contract and relevant race cases. - -## Packaging and tool provisioning - -The current CMake install already carries the Python project under -`share/protocyte/python`, alongside the installed CMake configuration and runtime -headers/targets. Reuse that model: - -- The Python wheel contains the engine, CLI, existing protoc plugin and runtime/ - schema data. Preserve `protoc-gen-protocyte`; add a separate `protocyte` entry - point so plugin stdin/stdout remains a binary protocol. -- FetchContent uses the checked-out Python sources. Installed-prefix consumption - uses the bundled Python project, selected explicitly from that prefix. -- The CMake coordinator launcher becomes a small compatibility entry point using - those exact sources. It must work before protobuf is installed, without finding - an unrelated globally installed package through the environment or working dir. -- Keep the existing managed-environment version/fingerprint checks and pinned - dependencies. Extend both source and installed generator-source dependency - lists to cover the new backend modules. -- Source and installed-package paths use the same engine version. A moved or - read-only package prefix must stay untouched; writable state belongs in the - consumer build/cache locations. - -Host tool resolution should be shared behind the interfaces. Ordinary supported -hosts can reuse supplied/compatible tools or acquire pinned, verified host tools -automatically where the integration allows it. Offline users and cross builds -keep explicit local host-tool overrides. Target compiler settings must not turn -`protoc` into an executable for the target platform. A new CLI should not need -CMake merely to orchestrate normal generation. - -## Performance design and safety boundary - -The algorithmic work belongs in the engine: - -1. Read and validate each immutable record once under the registry lock. -2. Separate record decoding/hashing from path-dependent authentication. -3. Observe distinct locations/components through an explicit validation context. -4. Build a transient index of all physical/lexical root and staging reservations. -5. Query that index for the current plans, and revalidate authority at the - required mutation boundaries. - -The desired metadata cost tracks unique paths/components and the required -validation passes, rather than retained claims multiplied by current plans. -See [the 30-second assessment](registry-validation-30s-plan.md) for measurements, -the authentication cost budget and the indexed algorithm's unresolved proof. - -This is not a general `Path.resolve` cache. An observation context must define -which names, directory identities and missing-component observations it relies -on; what makes them invalid; how it detects that; and what is freshly checked -before mutation. Registry locking does not freeze external topology, and two -matching metadata sweeps alone are not sufficient proof. In particular, validating -only the current output root does not protect a negative conflict result that -depends on a changed foreign path. - -Keep the existing shared registry, records, claim lifecycle and lock order for -the first implementation. Do not acquire registry while holding generation -locks: `prepare` finishes and releases its locks before `run` acquires its -generation/publication locks. `run` freshly rejects a task made stale in that -interval. Any later lock-wait optimization must remain compatible with old -coordinator processes sharing the namespace. - -The index is a candidate optimization until its observation/commit contract is -reviewable and preserves alias, reparse, path-replacement, ownership, concurrent -writer and recovery behavior. A safe fallback or fail-closed error is required -for unsupported/unstable topology; fallback time and occurrence must be measured -and cannot be hidden when claiming the 30-second target. - -## Implementation sequence - -1. **Define contracts and benchmark fixtures.** Freeze the existing engine as a - behavioral reference. Establish the 2,172-claim/11-plan workload plus anonymous - existing/missing-root, depth, target-count and shared-build variants. Inventory - the filesystem guarantees currently supplied by both CMake and Python. -2. **Prove the new validation core behind the current entry point.** Refactor - record authentication and prototype the indexed observation model with 64/256 - claims first. Keep the current public helpers and generation path while - resolving the safety proof. Proceed to larger cases only after the operation - counts and measured budget justify them. This is the first decisive milestone. -3. **Package the proven engine.** Move the established boundaries into the Python - package, retaining a compatibility launcher and record/lock interoperability. - Make the POC and benchmark import the real implementation and fingerprint its - source bundle. Measuring a thin launcher and reporting zero projections would - be a false improvement. -4. **Thin the CMake adapter incrementally.** Move one orchestration responsibility - at a time, retaining transport, dependency, timeout, cross-build, multi-config, - ownership and recovery tests. Remove replaced CMake guards only after proving - equivalent protection at the corresponding engine boundary. -5. **Expose the standalone CLI.** Reuse the exact planning/run API and shared - ownership rules. Test the one-command normal case and actionable failures; - do not make users operate the internal protocol or reset state to upgrade. - -Do not combine a new database, registry-format migration, lock-order change, -language rewrite and user-facing configuration system with this first fix. -Those would obscure whether the algorithm is faster and whether safety survived. - -## Acceptance criteria - -- All validation, including authentication and required freshness checks, is - below 30 seconds for the stated 2,172/11 benchmark environments; aim below - 25 seconds to leave margin. Report setup, lock wait and reconciliation separately. -- Metadata operation growth follows unique geometry/reservations, with every - retained claim still authenticated and all overlap/ownership rules retained. -- Adversarial mutation, alias, concurrent-writer and crash-recovery tests pass, - alongside a reviewed argument for the new observation lifetime. -- Existing quickstart, FetchContent, installed-prefix and superbuild consumers - work without new project configuration or manual environment activation. -- Moved/read-only prefixes, offline tool overrides and cross compilation remain - supported, with explicit host-tool selection where required. -- An unchanged second build does no unnecessary code generation; import and - tool/backend changes still trigger the appropriate work. -- The new standalone normal case works through one command after tool installation. - Internal task manifests, registry maintenance and performance switches stay - out of the required user workflow. - -The first experimental core now exists behind the current entry point in shadow -mode; see [its results](experimental-index-results.md) and -[authority contract](experimental-index-contract.md). The new CLI and packaged -backend described here have not been implemented, and the safe 30-second target -is not yet proven. diff --git a/docs/mr55-review-results.json b/docs/mr55-review-results.json deleted file mode 100644 index 71c75aa..0000000 --- a/docs/mr55-review-results.json +++ /dev/null @@ -1,1632 +0,0 @@ -{ - "date": "2026-11-16", - "reviewed_pull_request": 55, - "review_start_head": "1d1e1b030c2d4738c7778a22f1f5fc8effa24b3a", - "branch": "codex/experimental-generation-engine", - "decision": { - "merge_recommendation": "hold indexed promotion; keep MR draft", - "production_index_qualified": false, - "default_validation": "reference", - "consumer_cannot_enable_unqualified_index": true, - "required_validation_seconds": 30, - "reliable_timing_gate_passed": false - }, - "findings": [ - { - "priority": "P1", - "title": "Incomplete helpers could authorize overlapping staging", - "before": "A syntactically valid truncated pre-review helper accepted a root/staging conflict that fresh reference rejected.", - "fix": "Typed EOF capability markers and checks in both caller and helper entry points prevent incomplete or mixed helpers from gaining authority, including older callers.", - "status": "fixed", - "reproducer": { - "baseline_commit": "1d1e1b0", - "valid_truncated_helper_compiled": true, - "indexed_overlap_accepted": true, - "fresh_reference_overlap_rejected": true, - "current_claim_created": false, - "unsafe_reconciliation_executed": false - } - }, - { - "priority": "P2", - "title": "Worker bookkeeping and lost wakeups could strand retirement", - "before": "An admission bookkeeping MemoryError left active=1 with no native query running; a failed final notification could strand a draining owner.", - "fix": "Admission is inside the retirement finally; active work retires before optional accounting, and draining rechecks the fence with a bounded condition wait.", - "status": "fixed" - }, - { - "priority": "P2", - "title": "Native acquisition and release errors crossed the cleanup boundary", - "before": "An interrupted successful open lost an uncounted handle; failed close accounting could still permit reference authorization.", - "fix": "Unpublished output handles are retired on foreign-call exceptions; uncertain close completion is latched as fatal, never retried, and never permits fallback authorization.", - "status": "fixed", - "primary_source": "https://learn.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-closehandle" - }, - { - "priority": "P2", - "title": "Routine CI depended on experimental branch history", - "before": "Pinned git-show unit tests could fail after shallow checkout, squash merge or branch deletion.", - "fix": "Routine contract tests are self-contained; actual pinned old/helper/coordinator checks live in the explicit 115-case historical-source qualifier. CI no longer fetches all history for these unit tests.", - "status": "fixed" - } - ], - "final_implementation_files": { - "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", - "ProtocyteOwnershipIndex.py": "bb9b4f8f6325861706aa2ea5e270e013a862f53f3485d3d06dcc2e1cdfde5630", - "ProtocytePathObservation.py": "9edce3ad2770452bdbbe0f610bba71b9a5708f6fa67d638aab44c5763ae764f0", - "ProtocyteObservationCommit.py": "d6cf05762997718e535a16a8392e26f7794b53a547774c58fa5472c9591bbba9" - }, - "git_normalized_implementation_files": { - "ProtocyteOutputCoordinator.py": "f67a30883f713471ea661e8488903bef75108888bc5b247aa4f4dd0ba826814a", - "ProtocyteOwnershipIndex.py": "bb9b4f8f6325861706aa2ea5e270e013a862f53f3485d3d06dcc2e1cdfde5630", - "ProtocytePathObservation.py": "9edce3ad2770452bdbbe0f610bba71b9a5708f6fa67d638aab44c5763ae764f0", - "ProtocyteObservationCommit.py": "d6cf05762997718e535a16a8392e26f7794b53a547774c58fa5472c9591bbba9" - }, - "source_normalization": { - "difference": "CRLF to LF only", - "ast_identical": true - }, - "internal_helper_contracts": { - "commit": 2, - "ownership": 1, - "path": 1, - "published_at_eof": true - }, - "ownership_protocol_version": 1, - "wire_lock_reference_and_mutation_ast_unchanged_since_review_start": [ - "FileLock", - "Plan", - "_canonical_json", - "_path_key", - "_load_json", - "_validate_staging_path", - "OutputCoordinator._validate_registry_reference", - "OutputCoordinator._claim_paths", - "OutputCoordinator._load_recorded_plan", - "OutputCoordinator._validate_claim_shape", - "OutputCoordinator._require_plan_claim_binding", - "OutputCoordinator.reconcile_set", - "OutputCoordinator._reconcile_locked", - "OutputCoordinator.validate", - "OutputCoordinator.publish", - "OutputCoordinator.reset", - "OutputCoordinator._recover", - "OutputCoordinator._apply_pending", - "OutputCoordinator._publish_one", - "OutputCoordinator._initialize_claim_locked", - "OutputCoordinator._release_claim", - "OutputCoordinator._generation_lock", - "OutputCoordinator._publication_lock" - ], - "geometry_and_witness_ast_unchanged_since_review_start": [ - "WindowsObservationCommit._identity", - "WindowsObservationCommit._root", - "WindowsObservationCommit._view", - "WindowsObservationCommit._descriptor", - "WindowsObservationCommit._overlaps_views", - "WindowsObservationCommit.path_key", - "WindowsObservationCommit.contains", - "WindowsObservationCommit.physically_contains", - "WindowsObservationCommit.read_json", - "WindowsObservationCommit._collect_witnesses", - "WindowsObservationCommit.seal" - ], - "workload": { - "registry_entries": 2239, - "ledger_records": 4478, - "current_plans": 11, - "targets_per_plan": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 - ], - "declared_outputs": 232, - "committed_output_files_checked": 232, - "claims_plans_snapshots_and_outputs_unchanged": true, - "snapshot_byte_identical": true, - "tokens_produced": 0, - "reconciliation_authorized": false, - "ntfs_volumes": 2, - "python": "3.12.9", - "same_ledger_as_initial_mr_qualification": true, - "original_live_registry_and_lock_namespace": true, - "cold_os_cache_claimed": false - }, - "repeat_timing_gate": { - "planned_samples": 10, - "executed_samples": 5, - "stopped_on_first_threshold_failure": true, - "complete_reference_readers_during_every_sample": 2, - "samples_under_30_seconds": 4, - "wall_samples_seconds": [ - 28.856071299989708, - 29.55085189989768, - 29.314126100041904, - 28.384457200067118, - 30.115117600071244 - ], - "median_seconds": 29.314126100041904, - "source_note": "Cleanup fixes measured before final constructor-only compatibility guards; the comparison/IO algorithm is unchanged. This failed gate is not replaced by later controls.", - "run_intervals": [ - { - "run": 1, - "started_unix_seconds": 1794863913.365, - "finished_unix_seconds": 1794863943.043, - "validation_seconds": 28.856071299989708 - }, - { - "run": 2, - "started_unix_seconds": 1794863943.084, - "finished_unix_seconds": 1794863973.393, - "validation_seconds": 29.55085189989768 - }, - { - "run": 3, - "started_unix_seconds": 1794863973.411, - "finished_unix_seconds": 1794864003.564, - "validation_seconds": 29.314126100041904 - }, - { - "run": 4, - "started_unix_seconds": 1794864003.582, - "finished_unix_seconds": 1794864032.65, - "validation_seconds": 28.384457200067118 - }, - { - "run": 5, - "started_unix_seconds": 1794864032.668, - "finished_unix_seconds": 1794864063.642, - "validation_seconds": 30.115117600071244 - } - ], - "runs": [ - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", - "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", - "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de", - "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7" - }, - "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 28.856071299989708, - "validation_cpu_seconds": 30.796875, - "plan_parse_seconds": 0.22461200004909188, - "lock_wait_seconds": 0.41957729996647686, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 27.200438000028953, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 720656, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_cleanup_failed": false, - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", - "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", - "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de", - "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7" - }, - "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 29.55085189989768, - "validation_cpu_seconds": 30.953125, - "plan_parse_seconds": 0.20746730000246316, - "lock_wait_seconds": 0.4216287999879569, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 27.834398100036196, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719856, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_cleanup_failed": false, - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", - "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", - "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de", - "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7" - }, - "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 29.314126100041904, - "validation_cpu_seconds": 29.703125, - "plan_parse_seconds": 0.17460689996369183, - "lock_wait_seconds": 0.37870399991516024, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 27.75422489992343, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 720896, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_cleanup_failed": false, - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", - "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", - "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de", - "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7" - }, - "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 28.384457200067118, - "validation_cpu_seconds": 30.265625, - "plan_parse_seconds": 0.18637050001416355, - "lock_wait_seconds": 0.34978070005308837, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 26.784217200009152, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 720096, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_cleanup_failed": false, - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", - "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", - "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de", - "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7" - }, - "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 30.115117600071244, - "validation_cpu_seconds": 30.6875, - "plan_parse_seconds": 0.22936410002876073, - "lock_wait_seconds": 0.47622479998972267, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 28.19692970009055, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 720416, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_cleanup_failed": false, - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - } - ] - }, - "final_source_control_comparison": { - "formal_promotion_gate": false, - "interpretation": "descriptive single old/new samples under one continuing reference reader; no controlled regression or reliability claim", - "runs": [ - { - "mode": "old", - "started_unix_seconds": 1794864447.1990912, - "finished_unix_seconds": 1794864477.6079519, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "formal_gate_sample": false, - "result": "accepted", - "validation_seconds": 29.89271359995473, - "validation_cpu_seconds": 30.171875, - "plan_parse_seconds": 0.2687357999384403, - "lock_wait_seconds": 0.512010500067845, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 27.833131999941543, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 728416, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0, - "complete_reference_readers_during_sample": 1 - }, - { - "mode": "reviewed", - "started_unix_seconds": 1794864478.8702788, - "finished_unix_seconds": 1794864508.4931316, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", - "ProtocyteOwnershipIndex.py": "bb9b4f8f6325861706aa2ea5e270e013a862f53f3485d3d06dcc2e1cdfde5630", - "ProtocytePathObservation.py": "9edce3ad2770452bdbbe0f610bba71b9a5708f6fa67d638aab44c5763ae764f0", - "ProtocyteObservationCommit.py": "d6cf05762997718e535a16a8392e26f7794b53a547774c58fa5472c9591bbba9" - }, - "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", - "formal_gate_sample": false, - "result": "accepted", - "validation_seconds": 29.135975199984387, - "validation_cpu_seconds": 29.5, - "plan_parse_seconds": 0.23981910001020879, - "lock_wait_seconds": 0.4828729999717325, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 26.958232400007546, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719616, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_cleanup_failed": false, - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0, - "complete_reference_readers_during_sample": 1 - } - ] - }, - "full_reference_oracles": [ - { - "mode": "legacy", - "implementation_files": { - "driver.py": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", - "legacy.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", - "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7", - "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", - "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", - "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de" - }, - "original_workload": true, - "frozen_sources": true, - "started_unix_seconds": 1794863478.6883984, - "finished_unix_seconds": 1794864731.773494, - "result": "accepted", - "registry_entries": 2239, - "claims_checked": 2239, - "validation_seconds": 1249.3908620000584, - "validation_cpu_seconds": 780.25, - "frozen_ledger": true, - "original_output_paths": true, - "original_namespace_checked_separately": true, - "live_shared_lock_held": false, - "ownership_or_output_mutations": 0 - }, - { - "mode": "reference", - "implementation_files": { - "driver.py": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", - "legacy.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", - "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7", - "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", - "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", - "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de" - }, - "original_workload": true, - "frozen_sources": true, - "started_unix_seconds": 1794863478.8033924, - "finished_unix_seconds": 1794864432.9595044, - "result": "accepted", - "registry_entries": 2239, - "claims_checked": 2239, - "validation_seconds": 948.4977354999864, - "validation_cpu_seconds": 572.734375, - "frozen_ledger": true, - "original_output_paths": true, - "original_namespace_checked_separately": true, - "live_shared_lock_held": false, - "ownership_or_output_mutations": 0 - } - ], - "oracle_source_provenance": { - "source_fingerprints": { - "driver.py": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", - "legacy.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", - "ProtocyteObservationCommit.py": "07aef70a2a6e0a428cf5d52ec1f4727f28723b251479548e90ba2475bb41a6f7", - "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", - "ProtocyteOwnershipIndex.py": "6ef189de3c19a52790d913ba45b7c0e59074704bbac5fd0c0e87e69e96ced829", - "ProtocytePathObservation.py": "62bc9e4901fbf31af1f4794b3764cb119ec848a3f78ce58b9e4469773221d7de" - }, - "final_reference_methods_ast_identical": true, - "native_helpers_unused_by_reference_oracles": true - }, - "preservation": { - "mode": "audit", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", - "ProtocyteOwnershipIndex.py": "bb9b4f8f6325861706aa2ea5e270e013a862f53f3485d3d06dcc2e1cdfde5630", - "ProtocytePathObservation.py": "9edce3ad2770452bdbbe0f610bba71b9a5708f6fa67d638aab44c5763ae764f0", - "ProtocyteObservationCommit.py": "d6cf05762997718e535a16a8392e26f7794b53a547774c58fa5472c9591bbba9" - }, - "qualification_driver_sha256": "7de5fed96bfbf63ffab4110fecf5d05b18787b12c4d83fae4619f59538b49a5f", - "index_authorization_enabled": false, - "registry_entries": 2239, - "committed_output_files_checked": 232, - "claims_plans_snapshots_outputs_and_mtimes_unchanged": true, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - "verification": { - "full_python314_suite": { - "passed": 1983, - "skipped": 41 - }, - "explicit_indexed_coordinator_suite": { - "passed": 89, - "skipped": 6 - }, - "minimum_python312_native_index_qualification": { - "passed": 257 - }, - "cmake_packaging_integration": { - "passed": 22, - "skipped": 1 - }, - "parallel_failure_and_upgrade_contract_tests": 120, - "cross_version_upgrade": { - "scope": "isolated Windows cross-version checks; no consumer registry accessed", - "legacy_git_blob": "25f1660190d3d1015fef3955814c8c737bd686c5", - "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", - "candidate_coordinator_sha256": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "fff3bff61a9a6c542ad934a9473ad8ec043c2f3a4767220c6715e845942889f4", - "ProtocyteOwnershipIndex.py": "bb9b4f8f6325861706aa2ea5e270e013a862f53f3485d3d06dcc2e1cdfde5630", - "ProtocytePathObservation.py": "9edce3ad2770452bdbbe0f610bba71b9a5708f6fa67d638aab44c5763ae764f0", - "ProtocyteObservationCommit.py": "d6cf05762997718e535a16a8392e26f7794b53a547774c58fa5472c9591bbba9" - }, - "candidate_helper_sha256": { - "ProtocyteOwnershipIndex.py": "bb9b4f8f6325861706aa2ea5e270e013a862f53f3485d3d06dcc2e1cdfde5630", - "ProtocytePathObservation.py": "9edce3ad2770452bdbbe0f610bba71b9a5708f6fa67d638aab44c5763ae764f0", - "ProtocyteObservationCommit.py": "d6cf05762997718e535a16a8392e26f7794b53a547774c58fa5472c9591bbba9" - }, - "mixed_source_sha256": { - "helper-8851bde": "2e91b0a1df0d12b5b8b61dfe037c53cecf7393861058a08a19cc6c96d52c2583", - "helper-1d1e1b0": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664", - "coordinator-1d1e1b0": "88fbf0a18beab9b55a6efad4c8136bdc023834de149f7bced1715a09420948ca" - }, - "unchanged_ast_methods_since_checkpoint": [ - "reconcile_set", - "_reconcile_locked", - "validate", - "publish", - "reset", - "_recover", - "_apply_pending", - "_publish_one", - "_initialize_claim_locked", - "_release_claim", - "_generation_lock", - "_publication_lock" - ], - "reference_validator_ast_unchanged_since_checkpoint": false, - "file_lock_ast_unchanged_since_checkpoint": true, - "passed_cases": 115, - "production_index_authorization_qualified": false, - "index_authority_enabled_only_in_isolated_fixture_module": true, - "indexed_validations": 32, - "index_authorized_validations": 30, - "indexed_reference_fallbacks": 2, - "cases": [ - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "reference", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "reference", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "shadow", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "native-shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "native-shadow", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "commit-shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "commit-shadow", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "indexed", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "indexed", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "default", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "default", - "reader": "old", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "actual-previous-helper-reference-fallback", - "revision": "8851bde", - "passed": true - }, - { - "kind": "actual-previous-helper-reference-fallback", - "revision": "1d1e1b0", - "passed": true - }, - { - "kind": "actual-previous-coordinator-updated-helper", - "failed_cleanup": false, - "passed": true - }, - { - "kind": "actual-previous-coordinator-updated-helper", - "failed_cleanup": true, - "passed": true - } - ] - }, - "ruff": "passed", - "cpp_files_touched": 0 - }, - "limits": [ - "The repeat timing gate failed; the index remains gated even though all sampled index answers agreed with reference.", - "Native queries must retire before root handles can close; blocked native IO can delay cancellation.", - "An uncertain failed close aborts the operation. Numeric handles are not retried because the OS may already have reused the value.", - "The consistency boundary remains past positive intervals with fresh negatives, not an atomic namespace freeze or protection against noncooperative record writers.", - "Capability, alias, journal and ordinary observation failures require complete safe cleanup before reference fallback.", - "Timing evidence covers this retained workload on one Windows/NTFS host with reused OS caches; it is not a universal latency guarantee." - ], - "privacy": "anonymous consumer; no paths, names, tokens, ledger contents, raw manifests or raw logs are published" -} diff --git a/docs/mr55-review-results.md b/docs/mr55-review-results.md deleted file mode 100644 index d5e98ca..0000000 --- a/docs/mr55-review-results.md +++ /dev/null @@ -1,154 +0,0 @@ -# MR #55 correctness and upgrade review - -**Hold indexed promotion.** Four findings were fixed, including a reproduced -false acceptance through a valid-but-truncated helper. Correctness, failure -paths, packaging and **115 actual-source upgrade/recovery cases pass**. -The repeat timing gate failed at **30.115 seconds** on its fifth sample, so -**the index is disabled and the default is reference validation**. The MR -remains a draft. The prior [20-run qualification](parallel-probe-results.md) -is preserved as historical evidence, not a promotion override. - -## Findings and fixes - -### [P1] Incomplete helpers could authorize overlapping staging - -A syntactically valid truncated pre-review helper accepted a root/staging conflict that fresh reference rejected. - -Typed EOF capability markers and checks in both caller and helper entry points prevent incomplete or mixed helpers from gaining authority, including older callers. - -### [P2] Worker bookkeeping and lost wakeups could strand retirement - -An admission bookkeeping MemoryError left active=1 with no native query running; a failed final notification could strand a draining owner. - -Admission is inside the retirement finally; active work retires before optional accounting, and draining rechecks the fence with a bounded condition wait. - -### [P2] Native acquisition and release errors crossed the cleanup boundary - -An interrupted successful open lost an uncounted handle; failed close accounting could still permit reference authorization. - -Unpublished output handles are retired on foreign-call exceptions; uncertain close completion is latched as fatal, never retried, and never permits fallback authorization. - -### [P2] Routine CI depended on experimental branch history - -Pinned git-show unit tests could fail after shallow checkout, squash merge or branch deletion. - -Routine contract tests are self-contained; actual pinned old/helper/coordinator checks live in the explicit 115-case historical-source qualifier. CI no longer fetches all history for these unit tests. - -The incomplete-helper reproducer used the exact pre-review source, truncated -at a valid Python boundary before current staging comparisons. Its index -accepted a staging/root overlap that fresh reference validation rejected. -The unsafe plan was never reconciled and no current claim was created. -Caller checks alone would not protect an older coordinator, so helper -constructors also check their EOF markers before acquiring OS resources. - -The cleanup tests cover failures before and after OS close completion. A -failed/uncertain numeric handle is never automatically retried; known -remaining roots close once, cleanup stays failed, and no reconciliation is -authorized. [Microsoft documents single-close usage and invalid-handle behavior](https://learn.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-closehandle). -Tests explicitly release only the handles their injector knows it withheld -before any OS close; production cannot make that assumption. - -## Repeat workload gate - -The same original anonymous configuration still has **2,239 claims**, -**4,478 claim/plan records**, **11 current plans**, and **232 generated files** -on two NTFS volumes. Its captured ledger is byte-identical to the initial MR -qualification. No claims were pruned, split or reset. Each fresh process uses -CPython 3.12.9 and the original registry/generation/publication locks. - -| Run | Complete validation | Under 30 seconds | -| --- | ---: | :---: | -| 1 | 28.856071 s | Yes | -| 2 | 29.550852 s | Yes | -| 3 | 29.314126 s | Yes | -| 4 | 28.384457 s | Yes | -| 5 | 30.115118 s | **No** | - -The intended ten-sample series stopped on the first failure. Both complete -reference readers were active throughout every sample. All five index answers -were accepted with verified witnesses, 261,703 fresh negative probes, 84,579 -comparisons, 4,478 authenticated records, fully retired workers and all 26,916 -native handles closed. The gate measures current-plan parsing and the complete -validation, including observer-mutex wait; ownership-lock wait is separate. -The fifth sample includes plan parsing even though the progress phase timer -alone was just below 30 seconds. No timing component was removed to pass. - -These samples include the cleanup fixes before final constructor-only -compatibility guards. The final source keeps the same comparison/IO algorithm -and remains disabled. A separate final-source control accepted the full ledger -in **29.136 seconds**, compared with **29.893 seconds** for the prior native -implementation. Both control samples overlapped the continuing legacy -reference reader, after the branch reference reader had completed. They are -descriptive single samples, not proof of a code regression or a reliable -latency bound, and do not replace the failed promotion gate. - -The result calls for more headroom before promotion. A quieter sample, -rounding away plan parsing, or the previous successful series cannot reopen -the source gate. No production index enablement is included in this revision. - -## Reference acceptance and preservation - -- Exact historical coordinator: all **2,239 claims accepted**, **1249.391 seconds** under concurrent reader/test load. -- Branch reference validator: all **2,239 claims accepted**, **948.498 seconds** under concurrent reader/test load. - -Slow oracles use byte-identical frozen ledgers and the original build/output/ -staging geometry, with original lock-namespace checks performed separately. -They hold no long-lived live shared registry lock. Their reference methods -are AST-identical to the final implementation; frozen native helper files -are not used by reference validation. Timings are not controlled speedup ratios. - -The final preservation audit verified original claim/plan bytes, current -snapshots, and all **232 generated-file hashes and mtimes**. Live qualification -created no tokens and performed no reconciliation, publication, reset or -ownership/output mutation. USN observation still posts counted journal -metadata. Raw consumer evidence remains ignored and anonymous. - -## Final correctness and upgrade qualification - -| Check | Result | -| --- | --- | -| CPython 3.14.4 complete suite, four pytest workers | 1,983 passed, 41 skipped | -| Explicit indexed coordinator suite | 89 passed, 6 skipped | -| Minimum CPython 3.12.9 native/index qualification | 257 passed | -| CMake packaging/integration | 22 passed, 1 skipped | -| Pinned actual-source upgrade, rollback and crash recovery | 115 passed | -| Ruff, source/AST and whitespace checks | Passed | - -The parallel/failure suite now has **120 cases**. It adds admission/completion -allocation failures, lost final wakeups, interrupted native opens, short/root -close errors before and after OS completion, no-retry cleanup, incompatible -helper versions, valid truncated sources, and old API shapes. The historical -qualifier additionally executes the actual previous helpers and previous -coordinator with the updated helpers, including fatal cleanup. Ordinary -tests need no experimental commit history or network fetch. - -**Protocol v1 is unchanged.** The plan/claim schema, tokens, path keys, lock -namespace/order, reference validator, publication and recovery methods are -AST-identical to the reviewed starting revision. Valid installations need no -migration, cache reset, regeneration or token rotation. Internal helper -contracts `(commit=2, ownership=1, path=1)` identify complete compatible Python -sources and do not change any on-disk format. Packaging installs the sibling -helpers; incompatible installations use reference before creating a read set. - -The default now stays reference on every platform. The hidden indexed CLI and -private mode cannot bypass the closed promotion guard. Only isolated fixtures -and the mutation-forbidden qualification harness override their own module. -Existing CMake commands keep working, with continued progress during long -reference validation and no new configuration or runtime dependency. - -## Remaining limits and next gate - -Native IO must finish before workers and roots can retire, so a blocked native -read can delay cancellation. Uncertain native cleanup aborts the operation. -The read set certifies past positive intervals with fresh negative probes; -it does not freeze the namespace or replace the existing cooperative-writer -and mutation-time boundaries. Capabilities and timing were exercised on one -Windows/NTFS host with reused OS caches, not a universal platform/load matrix. - -Before enabling the index again, improve worst-case headroom while preserving -all checks, then repeat the complete loaded and ordinary-default timing series -against the final source. The current failure remains a promotion blocker. - -The [machine-readable report](mr55-review-results.json) records source hashes, -unchanged-AST assertions, every timing sample/counter, oracle receipts, the -preservation audit and all 115 upgrade cases. diff --git a/docs/observation-commit-contract.md b/docs/observation-commit-contract.md deleted file mode 100644 index 902b858..0000000 --- a/docs/observation-commit-contract.md +++ /dev/null @@ -1,295 +0,0 @@ -# Experimental observation commit - -Status: index promotion is **closed** on `codex/experimental-generation-engine`. -The [MR review](mr55-review-results.md) fixed concurrency, cleanup and partial-upgrade -issues, but its repeat timing gate exceeded 30 seconds. Normal consumer commands -use reference validation; neither the hidden indexed flag nor the private mode -can override the source guard. Only isolated fixtures and the mutation-forbidden -qualification harness can exercise index authority in their own module. -`commit-shadow` remains available for differential checks with reference authority. -The earlier [parallel qualification](parallel-probe-results.md) is historical. - -This replaces the previous fresh-observation experiment's repeated full path -walks with a provisional read set. Its certificate verifies the requested native -object/version witnesses; it is not unconditional namespace authority. The read -set is discarded before reference fallback or an indexed acceptance, and before -any reconciliation mutation. There is no persistent filesystem cache, new claim -format, change to the ownership lock namespace, watcher, service, or privileged -setup. A separate observer mutex coordinates the journal markers described below. - -## Scope and dependencies - -The caller holds the existing registry, generation, and publication locks in the -existing order. Cooperative coordinators therefore cannot change the ownership -records while they are being authenticated. Each retained claim and recorded -plan is still read and checked against its canonical JSON encoding, record -schema, root key, build identity, plan digest, and projected paths. The index is -an in-memory derivative, never a replacement for authenticating those records. - -The prototype accepts local DOS-drive paths on NTFS with an already active USN -journal and the required ordinary-user handle operations, in a native 64-bit -AMD64 or ARM64 process without a caller thread impersonation token. It does not create or -configure a journal. Unsupported paths, filesystems, access, case-sensitive -directories at initial observation, record formats, API responses, resource -budgets, or changed observations abandon the candidate and run the reference -validator. A missing -capability never requests administrator access or a user configuration change. - -The caller context is checked before observation and again before starting -workers. A 32-bit or emulated process, an impersonating thread, an unavailable -context API, or any result other than `ERROR_NO_TOKEN` from `OpenThreadToken` -uses reference validation. New threads use the process context; silently moving -an impersonating caller's lookups to that context would change their meaning. -See [thread creation](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createthread) -and [thread token inspection](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-openthreadtoken). - -Windows object identity consists of the volume serial and the full 128-bit file -ID. Reaching a second drive with an already observed volume serial forces -reference fallback, preventing ambiguous root-handle routing. Every positive -path component is observed through a short root-relative -native open with `OBJ_DONT_REPARSE`. Only volume-root handles survive a lookup; -ordinary build, staging, registry, and record handles are promptly closed, with -read/write/delete sharing. A competing cleanup can delete an observed directory; -this invalidates the candidate instead of keeping the directory delete-pending -behind a long-lived handle. - -Positive reuse also requires every component's input spelling to exactly match -the canonical native spelling. Case variants, short-name aliases, and other -noncanonical spellings fall back. This is a correctness boundary, not a path -normalization performed on behalf of the caller. - -Trusted helper sources advertise internal contracts only at EOF: -`commit=2`, `ownership=1`, and `path=1`. Caller and helper-entry checks require -exact integer versions before acquiring native resources or building an index. -Entry checks also protect older coordinators that do not inspect those markers. -An incomplete or incompatible installation uses reference validation; these -markers do not change the v1 ownership format or require a consumer setting. - -## Positive read-set argument - -For each unique positive object, the prototype performs these steps: - -1. Obtain its identity and force a USN close record **before** collecting its - type, canonical path, ancestry, or contents. Save the returned USN. -2. Collect provisional facts. Reusing a previously observed object never resets - its starting USN, including when reached through a case alias. -3. Finish all indexed computations, re-enumerate relevant registry inventories, - and recheck DOS-drive and positive name bindings with root-relative opens. -4. Require each reopened object's identity and current USN to match the initial - values. Force a new close record and retain its exact returned USN. -5. Retrieve the **specific** end records. Every requested USN must identify the - expected file and contain exactly `USN_REASON_CLOSE`. Any accumulated reason, - missing record, wrong ID, duplicate witness, unknown version, malformed data, - journal reset, trimming, or bounded-read failure abandons the candidate. - -The end close record matters: equal metadata snapshots alone cannot rule out an -ABA change or pending reasons on a writer opened before observation. Microsoft -documents that a forced close includes current reasons for the file and returns -the USN associated with that operation. The filesystem specification describes -posting a nonzero USN change as advancing the volume sequence and updating the -file's USN. The inference used here is that a relevant NTFS mutation during an -object's observation interval either changes its version or appears among the -forced end record's reasons. The native tests exercise rename, content/timestamp, -and attribute-only reparse ABA changes, including a preexisting writer primed -with the same reason before registration. Additional tests inject those changes -after the last version read but before the end close is posted: the dirty end -record must reject a change that the preceding version read could not see. - -An adversarial native test found a counterexample to treating **all** metadata -as versioned: changing a directory's case-sensitivity flag and changing it back -can leave its USN unchanged and produce a clean end marker. The candidate does -not certify that flag's stability. It rejects initially case-sensitive objects -and rejects noncanonical positive spellings. An exact existing name binds to -the same object in either case mode; changing or removing that object's name -requires a rename/deletion witnessed by its version. Thus the reused geometry -does not depend on a case alias remaining usable. Fresh negative probes still -use the caller's exact spelling. Tests preserve the unjournaled flag -counterexample, test the exact-binding case, and require aliases to fall back. -The case-folded lexical predicate remains the reference validator's conservative -overlap rule; it is not used to resolve a native positive object. -Microsoft describes the lookup behavior under the directory flag in -[per-directory case sensitivity](https://devblogs.microsoft.com/commandline/per-directory-case-sensitivity-and-wsl/). - -This argument covers the anchored NTFS objects. DOS-device mappings are outside -the NTFS journal: reopening each drive at seal checks its final binding, not -whether it was temporarily remapped and restored. After each root is bound, all -lookups and refreshed negatives use its retained volume-root handle, so a -temporary DOS remapping cannot supply cached geometry from another volume. -Final bindings must still match. Later mutation checks resolve their paths -afresh under the unchanged v1 rules. - -Reading canonical record bytes under the registry lock retains the reference -implementation's cooperative-writer model; it does not claim an atomic data -snapshot against unsynchronized memory-mapped writers. The v1 writer protocol -uses the same existing locks and durable record operations. This is a retained -trust boundary, not a new guarantee about arbitrary external writers. - -Sources for that inference: - -- [Forced close record and accumulated reasons](https://learn.microsoft.com/en-us/windows/win32/api/winioctl/ni-winioctl-fsctl_write_usn_close_record) -- [Filesystem forced-close operation](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fsa/6b3e0c41-83b4-403e-bdf1-8443eafa8f00) -- [Posting a USN change](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fsa/2c897c5e-b29e-464d-825f-565ff587f7f1) -- [Root-relative object attributes and reparse refusal](https://learn.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_object_attributes) - -The unprivileged journal transport has narrower public documentation than the -ordinary volume read API. On the tested host, directory handles supply journal -epoch queries and unprivileged reads whose names are redacted. The implementation -uses the public V2/V3 record headers and requires positive coverage of every -exact marker. It never treats the absence of an event in this filtered transport -as evidence that nothing changed. A transport that omits a required marker -cannot produce a certificate. Native mutation tests qualify the relevant -semantics on the measured Windows/NTFS host. This does not claim a test matrix -covering every Windows build, filesystem filter, or security product; capability -failures or unverified replies on another installation use reference validation. - -## Missing paths are not indexed as stable - -Creating a child does **not** necessarily advance its parent's USN. A parent -version is therefore insufficient evidence that a previously missing child -remains absent. Missing roots and staging paths stay in a separate partition. -Whenever either side of a directional overlap comparison is missing, its first -missing component is freshly probed relative to the held volume root with -reparse traversal refused. The reverse direction refreshes those observations -again. The final binding sweep checks them once more. A dangling junction is an -existing reparse point, not a successful negative lookup. - -The positive partition uses the independently tested pure ownership index. -Comparisons against the negative partition retain fresh namespace checks; a -negative current endpoint compares against every reservation. Ownership and -same-build retirement exemptions remain the reference rules. This intentionally -retains an O(claims × plans × targets²) negative-check term. A faster sampled -index that assumes all missing paths remain absent would not meet this contract. - -As with the reference validator's successive fresh probes, absence can change -between system calls. This experiment does not claim an atomic snapshot or a -namespace freeze. Its goal is to justify cached **positive** geometry during the -calculations while preserving fresh negative checks. Existing mutation-time -checks remain necessary. The integration's boundary is a completed past -validation computation: seal has verified the positive intervals, all native -handles have been released, and the read set has been erased before the caller -can enter the unchanged reconciliation and mutation methods. There is no new -claim that namespace stability persists after validation returns. - -## Parallel comparisons and retirement - -The owner thread authenticates records and prepares every comparison endpoint -before freezing a private view map. Four workers process independent comparisons -in batches of 32, with at most eight pending batches. Results retain input order. -Workers receive immutable prepared views, perform the same directional overlap -predicate and fresh root-relative negative probes, and cannot register paths or -collect geometry. Counter updates use locks; correctness does not depend on the -Python GIL. Positive witnesses, negative checks, and ownership exemptions are -unchanged by scheduling. - -Only the owner may control the pool or observation phase. An admission gate -covers every native batch, including work queued by a submission that raises -before returning its future. Cleanup closes admission and drains all admitted -native work before cancelling queued futures and joining the executor. A -monotonic retirement fence is checked independently before clearing prepared -views or releasing root handles. Interruptions during the drain are deferred -until native work retires. No comparison can run during sealing or after root -release, and a failed seal grants no index authority. - -Admission bookkeeping belongs inside the same retirement `finally` as native -work. Active work retires before optional completion accounting. The drain uses -a bounded condition wait to recheck its fence if a worker's final notification -fails; a lost wakeup cannot strand an already-retired pool. - -A comparison error with successful cleanup can fall back to reference. Failure -to retire the pool safely raises a fatal coordinator error before reference can -authorize reconciliation. If retirement is unproved, cleanup preserves the -views and root bindings rather than releasing resources beneath a live worker. -Successful index authority requires a closed pool, zero active and pending work, -completed-comparison accounting equal to the requested count, a verified seal, -and complete native-handle closure. Shutdown and cancellation errors are not -treated as successful retirement. - -An exception can arrive after a native open writes an output handle but before -the caller receives it. The native wrapper releases that unpublished handle -exactly once and accounts for it before propagating the exception. Any failed -native release or unbalanced final accounting is fatal before reference can -authorize mutation, including failures involving short opens or volume roots. -Uncertain close completion is latched: numeric handles are never retried because -the OS may already have consumed and reused their value. Remaining known roots -close once; the operation stays failed. See -[CloseHandle usage](https://learn.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-closehandle). - -## Expiry, fallback, and operational costs - -Instances are local to one validation phase. Sealing disables further reads; -closing releases roots and clears all observations, locators, inventories, and -object tables. No certificate or path facts cross into claim initialization, -recovery, publication, reset, or the next invocation. A failed or unsupported -commit still runs the ordinary reference validator. Indexed conflicts also use -reference validation, preserving its diagnostics and acceptance behavior. -`commit-shadow` additionally treats a verified candidate conflict followed by -reference acceptance as a disagreement and fails closed. - -The experiment posts journal metadata records on observed objects, including -common ancestors. It does not modify their contents or namespace. These posts -are real filesystem work and are included in timing and operation counters. -They can invalidate another observer's saved versions even when neither changed -the geometry. Same-registry operations already serialize through the existing -lock. New observers in independent registries additionally share a per-user -`observation-commit-v1.lock` beneath the ordinary user cache (or temporary -directory fallback). It is acquired inside the existing ownership locks and -released before reference fallback or mutation. No additional ownership lock is -acquired while it is held, so it introduces no reverse lock-order dependency. -It changes neither registry identity nor old/new ownership exclusion. Other -users, older prototypes, or external marker writers can still invalidate a -candidate; such collisions conservatively fall back to reference validation. - -Bounds are 32,768 unique objects, 16 MiB per ownership record, and 64 MiB of -journal transport per volume. Exceeding them falls back. Metrics include native -opens, information queries, negative probes, close posts, version reads, epoch -queries, journal bytes/reads, record seeks/reads, directory enumerations, complete -registry inventories, name-binding checks, and opened/closed handle counts. -Published diagnostics retain no unrelated journal names, claim contents, paths, -or tokens. An exception records its type, not its message. - -## Upgrade contract and qualification gate - -Normal installations use reference validation on every platform while the -promotion guard is closed. Existing consumer commands and CMake configuration -need no changes. To explicitly select reference validation -for an existing build, set `PROTOCYTE_REGISTRY_VALIDATION=reference` in its -environment. Direct coordinator commands also accept -`--reference-registry-validation`. The environment accepts `auto` (the default) -or `reference`; unsupported values fail with a clear error. Explicit reference -selection does not require the native helper to work. - -Packaging installs -the additional trusted sibling Python helper, without requiring a new consumer -command or runtime dependency. Protocol v1, plan serialization, claim tokens, -lock locations, and recovery/publication formats are unchanged. Old and new -coordinators must be able to alternate, including recovery across crash cuts. - -One independent reference fix inspects a retained `plan.json` with `lstat` and -treats only `FileNotFoundError` as absence. A dangling link is rejected as -malformed state; inaccessible metadata fails validation instead of silently -skipping the record. Valid registries need no migration, reset, regeneration, or -token rotation. Malformed or unreadable recorded state requires its underlying -problem to be repaired rather than being skipped. - -The following promotion gates remain required. Correctness and upgrade evidence -is recorded in the review; repeat timing failed and blocks promotion: - -- Relevant native mutation semantics and fallback behavior are qualified for - the enabled capability, with the namespace and writer boundaries above explicit. -- Differential, race, malformed-state, crash-recovery, packaging, minimum-Python, - and old/new upgrade checks pass with the final source fingerprints. -- **All validation**, including current plans, every retained record, fresh - negatives, inventories, versions, witnesses, and handle release, reliably stays - below 30 seconds at the target scale and representative layouts/contention. -- The authoritative integration preserves the mutation-time boundary. The - experimental branch and draft MR remain subject to code review. - -The read-only qualification harness reports the entire validation cost, including -plan parsing, witness verification, worker retirement, and native-handle release, -separately from its optional reference oracle. It produces no tokens and -authorizes no reconciliation. The default-mode qualification exercises ordinary -production selection when the source gate is enabled. The review does not enable -that source gate. Ordinary `commit-shadow` -timings always include the mandatory reference pass; candidate timing must never -be presented as that full operation. The timing evidence covers the retained -workload and measured host, not a universal latency bound on every installation. diff --git a/docs/observation-commit-results.json b/docs/observation-commit-results.json deleted file mode 100644 index 292fa88..0000000 --- a/docs/observation-commit-results.json +++ /dev/null @@ -1,1492 +0,0 @@ -{ - "date": "2026-11-16", - "branch": "codex/experimental-generation-engine", - "starting_commit": "b17dfb7", - "promotion": { - "required_all_validation_seconds": 30, - "reliable_under_30_seconds": false, - "quiet_target_samples_under_30_seconds": true, - "full_target_reference_oracle_agreement": true, - "default": "reference", - "authoritative": "reference", - "index_authorization_enabled": false, - "private_experiment": "commit-shadow", - "certificate_meaning": "exact native object/version close witnesses verified; no permission to bypass reference validation" - }, - "platform": "Windows", - "measurement_python": "3.12.9", - "default_test_python": "3.14.4", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "git_normalized_implementation_files": { - "ProtocyteOutputCoordinator.py": "bb319ff840abaeec63c8bc0caead22499ee0c5de10d459eb08baefd15f43a363", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "source_normalization": { - "difference": "CRLF to LF only", - "files": [ - "ProtocyteOutputCoordinator.py" - ], - "all_four_ast_identical": true - }, - "historical_candidate_scale_profiled": { - "scope": "read-only candidate on a previously seeded private synthetic registry; every record reauthenticated", - "fixture_reused": true, - "fixture_seed_implementation_files": { - "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "f6b9dbf2844bf16fb624f172b5f8e567e3ab0512b1a2971caf3de06453536777" - }, - "fixture_original_setup_wall_seconds": 330.13039900001604, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "samples": [ - { - "repetition": 0, - "scope": "complete read-only committed candidate; no reconciliation authority", - "reference_validation_performed": false, - "reference_result": null, - "reconciliation_authorized": false, - "tokens_produced": 0, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "retained_claims": 2172, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "setup_wall_seconds": 0.0, - "setup_cpu_seconds": 0.0, - "lock_preparation_and_wait_seconds": 0.3152406999724917, - "current_plan_validation_seconds": 0.9323760999832302, - "committed_candidate_wall_seconds": 37.11434189998545, - "committed_candidate_cpu_seconds": 32.546875, - "all_candidate_validation_wall_seconds": 38.0500783000025, - "all_candidate_validation_cpu_seconds": 33.34375, - "reference_oracle_wall_seconds": null, - "reference_oracle_cpu_seconds": null, - "candidate_filesystem_calls": { - "nt.stat": 3 - }, - "index_experiment": { - "mode": "commit-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2172, - "commit_certificate": "verified", - "commit_reservations": 4344, - "commit_index_queries": 22, - "commit_fresh_comparisons": 95568, - "commit_open_calls": 34824, - "commit_info_calls": 67473, - "commit_negative_probes": 412812, - "commit_close_posts": 21768, - "commit_version_reads": 15228, - "commit_epoch_queries": 3, - "commit_journal_reads": 1, - "commit_journal_bytes": 873928, - "commit_witnesses": 10884, - "commit_records_read": 4344, - "commit_binding_checks": 15249, - "commit_record_read_calls": 8688, - "commit_record_seek_calls": 4344, - "commit_directory_enumerations": 8706, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 30458, - "commit_handles_closed": 30458, - "commit_final_path_calls": 10884 - }, - "cprofile_enabled": true - }, - { - "repetition": 1, - "scope": "complete read-only committed candidate; no reconciliation authority", - "reference_validation_performed": false, - "reference_result": null, - "reconciliation_authorized": false, - "tokens_produced": 0, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "retained_claims": 2172, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "setup_wall_seconds": 0.0, - "setup_cpu_seconds": 0.0, - "lock_preparation_and_wait_seconds": 0.39175289997365326, - "current_plan_validation_seconds": 1.0265710999956354, - "committed_candidate_wall_seconds": 39.178787200013176, - "committed_candidate_cpu_seconds": 34.015625, - "all_candidate_validation_wall_seconds": 40.20758329995442, - "all_candidate_validation_cpu_seconds": 34.84375, - "reference_oracle_wall_seconds": null, - "reference_oracle_cpu_seconds": null, - "candidate_filesystem_calls": {}, - "index_experiment": { - "mode": "commit-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2172, - "commit_certificate": "verified", - "commit_reservations": 4344, - "commit_index_queries": 22, - "commit_fresh_comparisons": 95568, - "commit_open_calls": 34824, - "commit_info_calls": 67473, - "commit_negative_probes": 412812, - "commit_close_posts": 21768, - "commit_version_reads": 15228, - "commit_epoch_queries": 3, - "commit_journal_reads": 1, - "commit_journal_bytes": 873288, - "commit_witnesses": 10884, - "commit_records_read": 4344, - "commit_binding_checks": 15249, - "commit_record_read_calls": 8688, - "commit_record_seek_calls": 4344, - "commit_directory_enumerations": 8706, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 30458, - "commit_handles_closed": 30458, - "commit_final_path_calls": 10884 - }, - "cprofile_enabled": true - }, - { - "repetition": 2, - "scope": "complete read-only committed candidate; no reconciliation authority", - "reference_validation_performed": false, - "reference_result": null, - "reconciliation_authorized": false, - "tokens_produced": 0, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "retained_claims": 2172, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "setup_wall_seconds": 0.0, - "setup_cpu_seconds": 0.0, - "lock_preparation_and_wait_seconds": 0.3528101000119932, - "current_plan_validation_seconds": 0.9122066999552771, - "committed_candidate_wall_seconds": 34.563924699963536, - "committed_candidate_cpu_seconds": 30.953125, - "all_candidate_validation_wall_seconds": 35.47807960002683, - "all_candidate_validation_cpu_seconds": 31.765625, - "reference_oracle_wall_seconds": null, - "reference_oracle_cpu_seconds": null, - "candidate_filesystem_calls": {}, - "index_experiment": { - "mode": "commit-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2172, - "commit_certificate": "verified", - "commit_reservations": 4344, - "commit_index_queries": 22, - "commit_fresh_comparisons": 95568, - "commit_open_calls": 34824, - "commit_info_calls": 67473, - "commit_negative_probes": 412812, - "commit_close_posts": 21768, - "commit_version_reads": 15228, - "commit_epoch_queries": 3, - "commit_journal_reads": 1, - "commit_journal_bytes": 872328, - "commit_witnesses": 10884, - "commit_records_read": 4344, - "commit_binding_checks": 15249, - "commit_record_read_calls": 8688, - "commit_record_seek_calls": 4344, - "commit_directory_enumerations": 8706, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 30458, - "commit_handles_closed": 30458, - "commit_final_path_calls": 10884 - }, - "cprofile_enabled": true - } - ], - "matches_final_implementation": false, - "historical_reason": "before final reference metadata-error correction; native observation helper unchanged" - }, - "historical_candidate_scale_timer_only": { - "scope": "read-only candidate on a previously seeded private synthetic registry; every record reauthenticated", - "fixture_reused": true, - "fixture_seed_implementation_files": { - "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "f6b9dbf2844bf16fb624f172b5f8e567e3ab0512b1a2971caf3de06453536777" - }, - "fixture_original_setup_wall_seconds": 330.13039900001604, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "samples": [ - { - "repetition": 0, - "scope": "complete read-only committed candidate; no reconciliation authority", - "cprofile_enabled": false, - "reference_validation_performed": false, - "reference_result": null, - "reconciliation_authorized": false, - "tokens_produced": 0, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "retained_claims": 2172, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "setup_wall_seconds": 0.0, - "setup_cpu_seconds": 0.0, - "lock_preparation_and_wait_seconds": 0.6369367000297643, - "current_plan_validation_seconds": 1.8816780000342987, - "committed_candidate_wall_seconds": 43.777817099995445, - "committed_candidate_cpu_seconds": 32.515625, - "all_candidate_validation_wall_seconds": 45.65951369999675, - "all_candidate_validation_cpu_seconds": 33.984375, - "reference_oracle_wall_seconds": null, - "reference_oracle_cpu_seconds": null, - "candidate_filesystem_calls": null, - "index_experiment": { - "mode": "commit-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2172, - "commit_certificate": "verified", - "commit_reservations": 4344, - "commit_index_queries": 22, - "commit_fresh_comparisons": 95568, - "commit_open_calls": 34824, - "commit_info_calls": 67473, - "commit_negative_probes": 412812, - "commit_close_posts": 21768, - "commit_version_reads": 15228, - "commit_epoch_queries": 3, - "commit_journal_reads": 1, - "commit_journal_bytes": 873368, - "commit_witnesses": 10884, - "commit_records_read": 4344, - "commit_binding_checks": 15249, - "commit_record_read_calls": 8688, - "commit_record_seek_calls": 4344, - "commit_directory_enumerations": 8706, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 30458, - "commit_handles_closed": 30458, - "commit_final_path_calls": 10884 - } - }, - { - "repetition": 1, - "scope": "complete read-only committed candidate; no reconciliation authority", - "cprofile_enabled": false, - "reference_validation_performed": false, - "reference_result": null, - "reconciliation_authorized": false, - "tokens_produced": 0, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "retained_claims": 2172, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "setup_wall_seconds": 0.0, - "setup_cpu_seconds": 0.0, - "lock_preparation_and_wait_seconds": 0.3997910999460146, - "current_plan_validation_seconds": 1.2419860000372864, - "committed_candidate_wall_seconds": 54.65512499999022, - "committed_candidate_cpu_seconds": 39.828125, - "all_candidate_validation_wall_seconds": 55.897128199983854, - "all_candidate_validation_cpu_seconds": 40.78125, - "reference_oracle_wall_seconds": null, - "reference_oracle_cpu_seconds": null, - "candidate_filesystem_calls": null, - "index_experiment": { - "mode": "commit-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2172, - "commit_certificate": "verified", - "commit_reservations": 4344, - "commit_index_queries": 22, - "commit_fresh_comparisons": 95568, - "commit_open_calls": 34824, - "commit_info_calls": 67473, - "commit_negative_probes": 412812, - "commit_close_posts": 21768, - "commit_version_reads": 15228, - "commit_epoch_queries": 3, - "commit_journal_reads": 1, - "commit_journal_bytes": 873288, - "commit_witnesses": 10884, - "commit_records_read": 4344, - "commit_binding_checks": 15249, - "commit_record_read_calls": 8688, - "commit_record_seek_calls": 4344, - "commit_directory_enumerations": 8706, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 30458, - "commit_handles_closed": 30458, - "commit_final_path_calls": 10884 - } - }, - { - "repetition": 2, - "scope": "complete read-only committed candidate; no reconciliation authority", - "cprofile_enabled": false, - "reference_validation_performed": false, - "reference_result": null, - "reconciliation_authorized": false, - "tokens_produced": 0, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "retained_claims": 2172, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "setup_wall_seconds": 0.0, - "setup_cpu_seconds": 0.0, - "lock_preparation_and_wait_seconds": 0.5346634000306949, - "current_plan_validation_seconds": 1.7342174000223167, - "committed_candidate_wall_seconds": 79.99075850000372, - "committed_candidate_cpu_seconds": 56.078125, - "all_candidate_validation_wall_seconds": 81.72499359998619, - "all_candidate_validation_cpu_seconds": 57.28125, - "reference_oracle_wall_seconds": null, - "reference_oracle_cpu_seconds": null, - "candidate_filesystem_calls": null, - "index_experiment": { - "mode": "commit-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2172, - "commit_certificate": "verified", - "commit_reservations": 4344, - "commit_index_queries": 22, - "commit_fresh_comparisons": 95568, - "commit_open_calls": 34824, - "commit_info_calls": 67473, - "commit_negative_probes": 412812, - "commit_close_posts": 21768, - "commit_version_reads": 15228, - "commit_epoch_queries": 3, - "commit_journal_reads": 1, - "commit_journal_bytes": 872248, - "commit_witnesses": 10884, - "commit_records_read": 4344, - "commit_binding_checks": 15249, - "commit_record_read_calls": 8688, - "commit_record_seek_calls": 4344, - "commit_directory_enumerations": 8706, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 30458, - "commit_handles_closed": 30458, - "commit_final_path_calls": 10884 - } - } - ], - "matches_final_implementation": false, - "historical_reason": "before final reference metadata-error correction; native observation helper unchanged" - }, - "candidate_scale_timer_only": { - "scope": "read-only candidate on a previously seeded private synthetic registry; every record reauthenticated", - "fixture_reused": true, - "fixture_seed_implementation_files": { - "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "f6b9dbf2844bf16fb624f172b5f8e567e3ab0512b1a2971caf3de06453536777" - }, - "fixture_original_setup_wall_seconds": 330.13039900001604, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "samples": [ - { - "repetition": 0, - "scope": "complete read-only committed candidate; no reconciliation authority", - "cprofile_enabled": false, - "reference_validation_performed": false, - "reference_result": null, - "reconciliation_authorized": false, - "tokens_produced": 0, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "retained_claims": 2172, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "setup_wall_seconds": 0.0, - "setup_cpu_seconds": 0.0, - "lock_preparation_and_wait_seconds": 0.1702563000144437, - "current_plan_validation_seconds": 0.5166338999988511, - "committed_candidate_wall_seconds": 24.800610000034794, - "committed_candidate_cpu_seconds": 21.75, - "all_candidate_validation_wall_seconds": 25.31726109998999, - "all_candidate_validation_cpu_seconds": 22.25, - "reference_oracle_wall_seconds": null, - "reference_oracle_cpu_seconds": null, - "candidate_filesystem_calls": null, - "index_experiment": { - "mode": "commit-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2172, - "commit_certificate": "verified", - "commit_reservations": 4344, - "commit_index_queries": 22, - "commit_fresh_comparisons": 95568, - "commit_open_calls": 34824, - "commit_info_calls": 67473, - "commit_negative_probes": 412812, - "commit_close_posts": 21768, - "commit_version_reads": 15228, - "commit_epoch_queries": 3, - "commit_journal_reads": 1, - "commit_journal_bytes": 872008, - "commit_witnesses": 10884, - "commit_records_read": 4344, - "commit_binding_checks": 15249, - "commit_record_read_calls": 8688, - "commit_record_seek_calls": 4344, - "commit_directory_enumerations": 8706, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 30458, - "commit_handles_closed": 30458, - "commit_final_path_calls": 10884 - } - }, - { - "repetition": 1, - "scope": "complete read-only committed candidate; no reconciliation authority", - "cprofile_enabled": false, - "reference_validation_performed": false, - "reference_result": null, - "reconciliation_authorized": false, - "tokens_produced": 0, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "retained_claims": 2172, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "setup_wall_seconds": 0.0, - "setup_cpu_seconds": 0.0, - "lock_preparation_and_wait_seconds": 0.2692875000066124, - "current_plan_validation_seconds": 0.47470429999521, - "committed_candidate_wall_seconds": 19.509043800004292, - "committed_candidate_cpu_seconds": 18.578125, - "all_candidate_validation_wall_seconds": 19.98376149998512, - "all_candidate_validation_cpu_seconds": 19.0625, - "reference_oracle_wall_seconds": null, - "reference_oracle_cpu_seconds": null, - "candidate_filesystem_calls": null, - "index_experiment": { - "mode": "commit-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2172, - "commit_certificate": "verified", - "commit_reservations": 4344, - "commit_index_queries": 22, - "commit_fresh_comparisons": 95568, - "commit_open_calls": 34824, - "commit_info_calls": 67473, - "commit_negative_probes": 412812, - "commit_close_posts": 21768, - "commit_version_reads": 15228, - "commit_epoch_queries": 3, - "commit_journal_reads": 1, - "commit_journal_bytes": 872808, - "commit_witnesses": 10884, - "commit_records_read": 4344, - "commit_binding_checks": 15249, - "commit_record_read_calls": 8688, - "commit_record_seek_calls": 4344, - "commit_directory_enumerations": 8706, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 30458, - "commit_handles_closed": 30458, - "commit_final_path_calls": 10884 - } - }, - { - "repetition": 2, - "scope": "complete read-only committed candidate; no reconciliation authority", - "cprofile_enabled": false, - "reference_validation_performed": false, - "reference_result": null, - "reconciliation_authorized": false, - "tokens_produced": 0, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "retained_claims": 2172, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "setup_wall_seconds": 0.0, - "setup_cpu_seconds": 0.0, - "lock_preparation_and_wait_seconds": 0.19897550001041964, - "current_plan_validation_seconds": 0.48461739998310804, - "committed_candidate_wall_seconds": 18.090615799999796, - "committed_candidate_cpu_seconds": 17.75, - "all_candidate_validation_wall_seconds": 18.575247299973853, - "all_candidate_validation_cpu_seconds": 18.25, - "reference_oracle_wall_seconds": null, - "reference_oracle_cpu_seconds": null, - "candidate_filesystem_calls": null, - "index_experiment": { - "mode": "commit-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2172, - "commit_certificate": "verified", - "commit_reservations": 4344, - "commit_index_queries": 22, - "commit_fresh_comparisons": 95568, - "commit_open_calls": 34824, - "commit_info_calls": 67473, - "commit_negative_probes": 412812, - "commit_close_posts": 21768, - "commit_version_reads": 15228, - "commit_epoch_queries": 3, - "commit_journal_reads": 1, - "commit_journal_bytes": 871448, - "commit_witnesses": 10884, - "commit_records_read": 4344, - "commit_binding_checks": 15249, - "commit_record_read_calls": 8688, - "commit_record_seek_calls": 4344, - "commit_directory_enumerations": 8706, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 30458, - "commit_handles_closed": 30458, - "commit_final_path_calls": 10884 - } - } - ], - "matches_final_implementation": true - }, - "target_scale_reference_oracle": { - "scope": "read-only candidate on a previously seeded private synthetic registry; every record reauthenticated", - "fixture_reused": true, - "fixture_seed_implementation_files": { - "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "f6b9dbf2844bf16fb624f172b5f8e567e3ab0512b1a2971caf3de06453536777" - }, - "fixture_original_setup_wall_seconds": 330.13039900001604, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "samples": [ - { - "repetition": 0, - "scope": "complete read-only committed candidate; no reconciliation authority", - "cprofile_enabled": false, - "reference_validation_performed": true, - "reference_result": "accepted", - "reconciliation_authorized": false, - "tokens_produced": 0, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "retained_claims": 2172, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "setup_wall_seconds": 0.0, - "setup_cpu_seconds": 0.0, - "lock_preparation_and_wait_seconds": 0.1652985999826342, - "current_plan_validation_seconds": 0.5084627000032924, - "committed_candidate_wall_seconds": 21.547852299991064, - "committed_candidate_cpu_seconds": 20.609375, - "all_candidate_validation_wall_seconds": 22.056334599968977, - "all_candidate_validation_cpu_seconds": 21.078125, - "reference_oracle_wall_seconds": 310.0432202999946, - "reference_oracle_cpu_seconds": 290.171875, - "candidate_filesystem_calls": null, - "index_experiment": { - "mode": "commit-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2172, - "commit_certificate": "verified", - "commit_reservations": 4344, - "commit_index_queries": 22, - "commit_fresh_comparisons": 95568, - "commit_open_calls": 34824, - "commit_info_calls": 67473, - "commit_negative_probes": 412812, - "commit_close_posts": 21768, - "commit_version_reads": 15228, - "commit_epoch_queries": 3, - "commit_journal_reads": 1, - "commit_journal_bytes": 872488, - "commit_witnesses": 10884, - "commit_records_read": 4344, - "commit_binding_checks": 15249, - "commit_record_read_calls": 8688, - "commit_record_seek_calls": 4344, - "commit_directory_enumerations": 8706, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 30458, - "commit_handles_closed": 30458, - "commit_final_path_calls": 10884 - } - } - ], - "matches_final_implementation": true, - "agreement": true - }, - "full_shadow_samples": [ - { - "matches_final_implementation": true, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "revision": "candidate", - "repetition": 0, - "retained_claims": 64, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "seed_wall_seconds": 5.577846300031524, - "seed_cpu_seconds": 4.203125, - "validation_wall_seconds": 10.906187899992801, - "validation_cpu_seconds": 10.71875, - "reconcile_wall_seconds": 12.30889039998874, - "reconcile_cpu_seconds": 11.890625, - "lock_wait_wall_seconds": 0.20890930009773, - "registry_lock_held_wall_seconds": 12.290944800013676, - "current_plan_validation_wall_seconds": 0.5120710000046529, - "validation_engine": "commit-shadow", - "python_registry_scans": 1, - "native_registry_inventory_scans": 2, - "index_experiment": { - "mode": "commit-shadow", - "authoritative": "reference", - "preview_wall_seconds": 0.7804933000006713, - "reference_wall_seconds": 10.124300299969036, - "agreement": true, - "commit_claims_checked": 64, - "commit_certificate": "verified", - "commit_reservations": 128, - "commit_index_queries": 22, - "commit_fresh_comparisons": 2816, - "commit_open_calls": 1098, - "commit_info_calls": 2116, - "commit_negative_probes": 12292, - "commit_close_posts": 690, - "commit_version_reads": 473, - "commit_epoch_queries": 3, - "commit_journal_reads": 1, - "commit_journal_bytes": 27608, - "commit_witnesses": 345, - "commit_records_read": 128, - "commit_binding_checks": 494, - "commit_record_read_calls": 256, - "commit_record_seek_calls": 128, - "commit_directory_enumerations": 260, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 948, - "commit_handles_closed": 948, - "commit_final_path_calls": 345, - "preview_result": "accepted", - "reference_result": "accepted" - }, - "shadow_candidate_wall_seconds": 0.7804933000006713, - "reference_validation_wall_seconds": 10.124300299969036, - "registry_validations": 1, - "registry_scans": 3, - "recorded_plan_loads_in_validation": 128, - "path_projections_in_validation": 7621, - "path_projections_total": 8655, - "validation_filesystem_calls": { - "nt.stat": 174473, - "nt.lstat": 14664, - "nt._getfinalpathname": 15242 - }, - "completed_plans": 11 - }, - { - "matches_final_implementation": true, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "revision": "candidate", - "repetition": 0, - "retained_claims": 8, - "current_plans": 11, - "layout": { - "targets_per_plan": 3, - "shared_build_root": true, - "existing_directories": true - }, - "seed_wall_seconds": 1.6359737000311725, - "seed_cpu_seconds": 1.25, - "validation_wall_seconds": 4.962917600001674, - "validation_cpu_seconds": 4.734375, - "reconcile_wall_seconds": 8.172802199958824, - "reconcile_cpu_seconds": 7.671875, - "lock_wait_wall_seconds": 0.24166279996279627, - "registry_lock_held_wall_seconds": 8.135796799964737, - "current_plan_validation_wall_seconds": 2.2325147000374272, - "validation_engine": "commit-shadow", - "python_registry_scans": 1, - "native_registry_inventory_scans": 2, - "index_experiment": { - "mode": "commit-shadow", - "authoritative": "reference", - "preview_wall_seconds": 0.1537623000331223, - "reference_wall_seconds": 4.808976600004826, - "agreement": true, - "commit_claims_checked": 8, - "commit_certificate": "verified", - "commit_reservations": 32, - "commit_index_queries": 44, - "commit_fresh_comparisons": 0, - "commit_open_calls": 302, - "commit_info_calls": 725, - "commit_negative_probes": 0, - "commit_close_posts": 268, - "commit_version_reads": 150, - "commit_epoch_queries": 3, - "commit_journal_reads": 1, - "commit_journal_bytes": 10728, - "commit_witnesses": 134, - "commit_records_read": 16, - "commit_binding_checks": 133, - "commit_record_read_calls": 32, - "commit_record_seek_calls": 16, - "commit_directory_enumerations": 36, - "commit_full_inventory_scans": 2, - "commit_state": "closed", - "commit_handles_opened": 302, - "commit_handles_closed": 302, - "commit_final_path_calls": 134, - "preview_result": "accepted", - "reference_result": "accepted" - }, - "shadow_candidate_wall_seconds": 0.1537623000331223, - "reference_validation_wall_seconds": 4.808976600004826, - "registry_validations": 1, - "registry_scans": 3, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 3333, - "path_projections_total": 5775, - "validation_filesystem_calls": { - "nt.stat": 82032, - "nt.lstat": 3334, - "nt._getfinalpathname": 6666 - }, - "completed_plans": 11 - } - ], - "rejected_parent_lease_batch": { - "matches_final_implementation": false, - "retained_claims": 2172, - "current_plans": 11, - "implementation_files": { - "ProtocyteOutputCoordinator.py": "b587b9d0b4b47218c0bd1d3030706184a2962bbd5698bc33e26554c4dae408fc", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "db4bf01e660477616cc0c9da2847dbaa7adc2791aeae00064b00bf1ce80296f6" - }, - "all_candidate_validation_wall_seconds": 46.83222300000489, - "index_experiment": { - "mode": "commit-candidate-only", - "authoritative": "none", - "commit_claims_checked": 2172, - "commit_certificate": "verified", - "commit_reservations": 4344, - "commit_index_queries": 22, - "commit_fresh_comparisons": 95568, - "commit_open_calls": 85600, - "commit_info_calls": 118249, - "commit_negative_probes": 412812, - "commit_close_posts": 21768, - "commit_version_reads": 15228, - "commit_epoch_queries": 3, - "commit_journal_reads": 1, - "commit_journal_bytes": 873448, - "commit_witnesses": 10884, - "commit_records_read": 4344, - "commit_binding_checks": 15249, - "commit_record_read_calls": 8688, - "commit_record_seek_calls": 4344, - "commit_directory_enumerations": 8706, - "commit_full_inventory_scans": 2, - "commit_comparison_batches": 2992, - "commit_peak_parent_leases": 17, - "commit_relative_negative_probes": 382272, - "commit_state": "closed", - "commit_handles_opened": 81234, - "commit_handles_closed": 81234, - "commit_final_path_calls": 10884 - }, - "retained_in_code": false, - "reason": "extra opens and request construction increased total cost without reducing negative query cost" - }, - "qualification": { - "default_suite": { - "passed": 1834, - "skipped": 41, - "wall_seconds": 78.72 - }, - "commit_shadow_coordinator_suite": { - "passed": 89, - "skipped": 6, - "wall_seconds": 33.36 - }, - "minimum_python_3_12_observation_and_ownership": { - "passed": 109, - "skipped": 0, - "wall_seconds": 7.0 - }, - "cmake_integration": { - "passed": 19, - "skipped": 1, - "wall_seconds": 89.28 - }, - "upgrade_and_rollback": { - "scope": "isolated Windows cross-version checks; no consumer registry accessed", - "legacy_git_blob": "25f1660190d3d1015fef3955814c8c737bd686c5", - "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", - "candidate_coordinator_sha256": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "a11c1ced0752964b7dbd892c86f9e93412b759528b35da0b05002e6a77b0a1f0", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "candidate_helper_sha256": { - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "b512e67279e4fdb2c5eac1e7fd9d911df6f313a31df8e02867ae6c1790020bea" - }, - "unchanged_ast_methods_since_checkpoint": [ - "reconcile_set", - "_reconcile_locked", - "validate", - "publish", - "reset", - "_recover", - "_apply_pending", - "_publish_one", - "_initialize_claim_locked", - "_release_claim", - "_generation_lock", - "_publication_lock" - ], - "reference_validator_ast_unchanged_since_checkpoint": false, - "file_lock_ast_unchanged_since_checkpoint": true, - "passed_cases": 71, - "cases": [ - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "reference", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "reference", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "shadow", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "native-shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "native-shadow", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "commit-shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "commit-shadow", - "reader": "old", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - } - ] - } - }, - "notes": [ - "Candidate-only samples reauthenticate every real claim and plan in a previously seeded private registry; no current claims, tokens, or outputs are produced.", - "Current-plan validation, all candidate checks, close witnesses and handle release are included; setup and lock wait are reported separately.", - "Current plans are parsed during fixture preparation, as in the reconcile API benchmark; CLI plan parsing is outside these validation phase timings.", - "The fresh fixture was seeded once; repeated read sets do not imply a cold OS cache. Profiler and timer-only runs occurred separately on a workstation with variable timings.", - "As-run fingerprints retain Windows working-file bytes; Git-normalized fingerprints are recorded separately after verifying only CRLF-to-LF differences and identical ASTs for all four helpers.", - "Native calls are reported explicitly; cProfile's Python stat count alone is not total filesystem work. Full shadow registry_scans includes two native inventories plus the reference scan.", - "Initially case-sensitive directories and noncanonical positive spellings fall back; case-mode changes alone need not change NTFS USNs.", - "Independent observers' close markers can invalidate common ancestor versions and cause conservative reference fallback.", - "Unsupported capability, access, format, changed observations, resource limits, or unknown errors grant no indexed authority.", - "The NTFS object argument does not certify DOS-device mapping lifetime or an atomic snapshot against unsynchronized memory-mapped record writers.", - "Protocol v1, lock namespace, tokens, and recovery/publication formats are preserved. Dangling retained plan links and inaccessible record metadata now fail validation instead of being silently skipped." - ] -} diff --git a/docs/observation-commit-results.md b/docs/observation-commit-results.md deleted file mode 100644 index f042dfc..0000000 --- a/docs/observation-commit-results.md +++ /dev/null @@ -1,208 +0,0 @@ -# Observation commit experiment: results - -This is the historical synthetic qualification at commit `0fe8ad4`. Its source -fingerprints and closed promotion decision are retained below. See the newer -[retained consumer qualification](consumer-validation-results.md) for subsequent -serial measurements and the [parallel-probe qualification](parallel-probe-results.md) -for the initial enablement. The subsequent [MR review](mr55-review-results.md) -records the current closed promotion decision. The disabled default below is -the historical decision for this synthetic snapshot. - -The index remains **disabled as an authority** on -`codex/experimental-generation-engine`. The new read-set experiment has a safe -shadow integration, useful native evidence, and passing upgrade checks. It has -not met the requirement for reliable full validation below 30 seconds. - -The default is still reference validation. There is no index-only command or -automatic promotion. The private `--experimental-observation-commit` switch runs -the candidate and then mandatory reference validation before reconciliation. -Unsupported capabilities, changed observations, and candidate failures fall -back to reference. A verified candidate conflict that reference accepts fails -closed before claim initialization. - -## What changed - -[ProtocyteObservationCommit.py](../cmake/ProtocyteObservationCommit.py) implements -one bounded optimistic read set. It collects positive geometry after a forced -USN close marker, authenticates every retained claim and plan, and checks final -identities and versions against exact close-record witnesses. Missing witnesses, -dirty reasons, unknown formats, changed epochs, and bounded-read failures cannot -certify a candidate. The unprivileged journal stream is used to retrieve specific -positive witnesses; missing events are never interpreted as proof of stability. - -Only volume-root handles remain open between lookups. Ordinary directories and -record files use short opens, so deleting and recreating an observed build -directory is possible and invalidates the candidate. Observations expire before -reference validation, claim initialization, recovery, and output mutations. The -normal lock order and lock namespace remain unchanged. - -Missing paths are deliberately excluded from the stable index partition. Every -directional overlap comparison refreshes its missing endpoints, and seal checks -them again. This preserves the expensive term in missing-directory layouts. - -The [contract](observation-commit-contract.md) gives the consistency argument, -primary API sources, supported capabilities, costs, and remaining proof -boundaries. The certificate verifies its requested native witnesses; it is not -an unconditional filesystem snapshot or permission to skip reference validation. - -## Measured target scale - -The synthetic registry contains **2,172 real retained claims and 11 current -plans**, with one target per plan and missing output/staging directories. -Measurements use CPython 3.12.9 on Windows. Each run authenticates all **4,344 -ownership records** and includes current-plan validation, the complete candidate, -final inventories, versions, close witnesses, and handle release. - -| Measurement | Run 1 | Run 2 | Run 3 | -| --- | ---: | ---: | ---: | -| Final-source full candidate validation, wall/CPU timers without cProfile | 25.317 s | 19.984 s | 18.575 s | -| Earlier snapshot, with cProfile | 38.050 s | 40.208 s | 35.478 s | -| Earlier snapshot, wall/CPU timers without cProfile | 45.660 s | 55.897 s | 81.725 s | - -All three final-source quiet samples pass 30 seconds. They establish feasibility -for this reused synthetic layout, not reliable performance across configurations -and contention. The six earlier samples precede the final reference -metadata-error correction; the native observation helper is byte-identical. -They retain their own source fingerprints and are explicitly historical in the -report. The large timing spread remains a reason to keep the promotion gate -closed. These are separate workstation runs, not controlled comparisons of -profiler overhead. Timer-only runs retain every validation check and counter. - -Each candidate run performed **95,568 fresh reservation comparisons**, **412,812 -negative probes**, **21,768 forced close posts**, and verified **10,884 exact -end witnesses**. It performed two complete registry inventories, plus per-state -enumerations, and balanced all **30,458 opened and closed handles**. Native -information, file-read, seek, final-path, epoch, and journal calls are also -reported. Python's small `stat` count must not be presented as total filesystem -work. - -The registry was seeded once in a fresh private fixture, taking 330.130 seconds. -The three final-source samples reuse that fixture, create new read sets, and -reauthenticate every record each time. Setup and lock wait are reported -separately. A reused fixture or new process does not imply a cold OS cache. -The synthetic dimensions match the reported consumer case; its contents and -layout are synthetic. No consumer registry was accessed. - -These large runs are read-only candidate measurements: they produce no current -claim, token, reconciliation, or publication. They do not include a subsequent -reference pass and are not timings of the currently authorized reconciler. -As in the API benchmark, current plan files are parsed during fixture -preparation; CLI plan parsing is outside these validation phase timings. - -Final-source full shadow samples retain reference and reconciliation costs: - -| Layout (11 current plans) | Candidate registry phase | Reference registry phase | Current-plan set check | Entire reconcile call | -| --- | ---: | ---: | ---: | ---: | -| 64 claims, one target, missing directories | 0.780 s | 10.124 s | 0.512 s | 12.309 s | -| 8 claims, three targets, existing directories, shared build root | 0.154 s | 4.809 s | 2.233 s | 8.173 s | - -Both phases accepted in each sample, verified every required witness, and -balanced all handles. Each full sample counted **three** registry inventory -scans: two native candidate inventories and one reference scan. Per-state -enumerations are additional work. The complete counts and fingerprints are in -[the path-free report](observation-commit-results.json). - -A fourth final-source target-scale run also executed the complete fresh -reference oracle on the same **2,172/11** fixture. The full read-only candidate -took **22.056 seconds**; the separate reference registry pass took **310.043 -seconds**. Both accepted, all witnesses verified, and the fixture retained its -original 2,172 claims. No current tokens or reconciliation were produced. This -is agreement evidence and a phase comparison, not an enabled production speedup. - -## Counterexamples and rejected optimization - -- Parent-directory USNs do not reliably change when a missing child is created. - Parent versions therefore cannot justify cached absence. Native tests cover - creation after observation and changes between the two comparison directions. -- Case-mode changes can leave the directory USN unchanged, even after an ABA - toggle. Positive reuse now requires exact canonical spelling; aliases fall - back instead of assuming their continued usability. Tests retain this - counterexample and exercise exact bindings in both end modes. -- A writer opened before registration can repeat attribute-only reparse changes - and restore the original directory. Forced-close/version tests reject this, - including a writer primed with the same reason before the observation began. -- Holding ordinary directory handles for the whole operation obstructs cleanup. - The retained implementation closes them promptly and tests delete/recreate. -- A bounded parent-handle batching variant kept fresh probes, but added opens - and request construction without lowering negative-query cost. Its first - profiled target-scale validation took **46.832 seconds**. It was removed; the - report identifies its different source fingerprint and rejected status. - -The retained version's profile spends most of its time in negative namespace -queries. Further progress needs a proven way to avoid repeated missing-path -checks. The unprivileged journal's filtered, redacted stream is not proof that -all relevant namespace changes were absent. - -## Upgrade and regression evidence - -- Default suite on Python 3.14.4: **1,834 passed, 41 skipped**. -- Existing coordinator suite through commit-shadow: **89 passed, 6 skipped**. -- Observation/index and metadata-error tests on minimum Python 3.12: - **109 passed**, no skips. -- CMake/installed relocation checks: **19 passed, 1 skipped**. All three private - modes work after relocating the package, leave its files unchanged, and write - no bytecode caches into the prefix. -- Offline upgrade/rollback qualification: **71 passed cases** against the exact - public protocol-v1 source blob `25f1660190d3d1015fef3955814c8c737bd686c5`, also - present at commit `72fc9087f6d7fd1c133aaf33903df8ca1585fe69`. Its SHA-256 is - `2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85`. - -Upgrade cases alternate old/new coordinators, preserve existing claim bytes, -tokens and no-op output timestamps, publish in both directions, and recover -across four publication, two initialization, and three reset crash cuts. The -harness also verifies twelve mutation/lock methods and `FileLock` remain AST -identical to preservation checkpoint `f804fd1`. The reference-validator AST is -not identical: observation adapters and explicit validation fixes are recorded -rather than claiming the whole implementation is unchanged. - -Normal consumers need no new configuration, dependency, privilege, migration, -reset, or token rotation. Protocol v1, plan encoding, publication and recovery -formats remain compatible. The helper is installed through existing CMake -packaging; generated C++ and runtime ABI are untouched. - -One reference fix intentionally rejects a dangling retained `plan.json` link, -which was previously skipped as if no recorded plan existed. It uses `lstat` -and treats only `FileNotFoundError` as absence: inaccessible metadata must also -fail validation. Regression tests prove rejection before a new claim is -initialized and preservation of the existing token. Valid registries retain -their existing behavior; malformed or unreadable state must be repaired. - -## Remaining promotion blockers - -Sub-30-second validation is demonstrated in three quiet one-target samples; -reliability across fresh layouts and contention is unqualified. More targets -multiply the fresh negative comparisons. Independent read -sets can also invalidate each other's common-ancestor versions with their own -close markers, causing a conservative reference fallback. The experiment adds -real journal metadata writes and does not remove the existing locks. - -The native argument still needs qualification across supported Windows/NTFS -configurations. DOS-device mapping lifetime and unsynchronized record writers -are explicit boundaries in the contract, and no atomic namespace freeze is -claimed. Existing mutation-time checks remain necessary. An authoritative -integration requires separate review of those boundaries even if future -candidate timings improve. - -## Reproduction - -Run from a checkout with Python 3.12+; fixture/result directories must be new: - -```text -python tests/benchmark_observation_commit.py --claims 2172 --plans 11 --large --repeat 3 --work NEW_PRIVATE_DIRECTORY -python tests/benchmark_observation_commit.py --claims 2172 --plans 11 --large --repeat 3 --no-profile --work ANOTHER_NEW_PRIVATE_DIRECTORY -python tests/benchmark_output_registry.py --registry-validation commit-shadow --claims 64 --plans 11 --repeat 1 --work NEW_SHADOW_DIRECTORY -python tests/verify_coordinator_upgrade.py --work NEW_UPGRADE_DIRECTORY -``` - -The public candidate tool seeds fresh fixtures per sample; the target-scale -measurements above used an explicitly reported reused fixture to avoid repeated setup. -Use `--reference-oracle` to time a separate fresh reference pass in the read-only -candidate tool. It still produces no current tokens or reconciliation. -Upgrade qualification requires the pinned source blob and checkpoint in local -Git history. Fixture directories, profiles, logs, claims, and tokens remain -private; share only the sanitized result JSON. Source-drift guards reject -measurements or qualification if the implementation changes during the run. - -The report keeps the as-run source hashes and Git-normalized hashes separately. -Git changes only the coordinator's CRLF line endings to LF; byte normalization -and AST comparisons verify identical code for all four implementation files. diff --git a/docs/observation-mechanism-results.json b/docs/observation-mechanism-results.json deleted file mode 100644 index c2835a8..0000000 --- a/docs/observation-mechanism-results.json +++ /dev/null @@ -1,830 +0,0 @@ -{ - "status": "operation-wide observation proof and timing gate FAILED; index stays non-authoritative", - "normal_validation": "reference", - "index_authorization_enabled": false, - "current_implementation_files": { - "ProtocyteOutputCoordinator.py": "8701f91a82a033aed9cfdb1909bcc135ecd695d56c84271e1f382e76c2b1348b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4" - }, - "notes": [ - "All registries are fresh explicit synthetic fixtures; no consumer/shared registry accessed.", - "Native and reference registry phases, current-plan validation, setup, locks and reconciliation remain distinct.", - "Native API counters supplement profiled Python filesystem calls; they are not counted as eliminated observations.", - "All reported performance samples include full reference verification; none is an index-only speedup.", - "The current source restricts explicit extended namespace paths to reference fallback after the second measured snapshot; measured fingerprints are retained unchanged.", - "No 2172-claim native scaling sample was run because the bounded pilot failed the research cost gate.", - "Timing variation, instrumentation and uncontrolled workstation/cache effects prevent a reliable under-30-second claim." - ], - "native_counterexample": { - "real_attribute_only_directory_to_junction_conversion_while_read_handle_open": true, - "fresh_observer_rejected_conversion": true, - "operation_wide_read_handle_lease_disproved": true - }, - "journal_probe": { - "fresh_test_directory_close_record_supported": true, - "zero_access_volume_query_supported": false, - "volume_query_win32_error": 1, - "journal_created_or_configured": false, - "journal_authority_implemented": false - }, - "verification": { - "full_default": { - "passed": 1772, - "skipped": 41 - }, - "native_shadow_coordinator": { - "passed": 87, - "skipped": 6 - }, - "cmake_integration": { - "passed": 18, - "skipped": 1 - }, - "native_observation_tests": 22, - "minimum_python_observation_and_index": { - "passed": 48 - }, - "explicit_namespace_upgrade_preserved_claim": true, - "cross_version_upgrade_and_recovery": 51, - "minimum_python": "3.12.9" - }, - "measurements": { - "pilot": { - "platform": "Windows", - "python": "3.12.9", - "timings_include_instrumentation": true, - "setup_method": "private locked initialization/reconciliation (issue #54 POC)", - "coordinator_sha256": { - "candidate": "8701f91a82a033aed9cfdb1909bcc135ecd695d56c84271e1f382e76c2b1348b" - }, - "implementation_files": { - "candidate": { - "ProtocyteOutputCoordinator.py": "8701f91a82a033aed9cfdb1909bcc135ecd695d56c84271e1f382e76c2b1348b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "b7de52b7cf5f823bf6491ccd9cdf89f732ebc87655dd8116a5bf0fbf99789bf0" - } - }, - "samples": [ - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 8, - "current_plans": 1, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "seed_wall_seconds": 1.3629234000109136, - "seed_cpu_seconds": 0.734375, - "validation_wall_seconds": 0.6381476999958977, - "validation_cpu_seconds": 0.484375, - "reconcile_wall_seconds": 0.9638928000349551, - "reconcile_cpu_seconds": 0.59375, - "lock_wait_wall_seconds": 0.03132269997149706, - "registry_lock_held_wall_seconds": 0.9450623000157066, - "current_plan_validation_wall_seconds": 3.1999661587178707e-06, - "validation_engine": "native-shadow", - "index_experiment": { - "mode": "native-shadow", - "authoritative": "reference", - "preview_wall_seconds": 0.19492140004877, - "reference_wall_seconds": 0.44041520002065226, - "agreement": true, - "native_claims_checked": 8, - "preview_result": "accepted", - "native_projections": 229, - "native_open_calls": 387, - "native_information_calls": 229, - "native_final_path_calls": 229, - "native_handles_opened": 229, - "native_handles_closed": 229, - "reference_result": "accepted" - }, - "shadow_candidate_wall_seconds": 0.19492140004877, - "reference_validation_wall_seconds": 0.44041520002065226, - "registry_validations": 1, - "registry_scans": 2, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 229, - "path_projections_total": 293, - "validation_filesystem_calls": { - "nt.stat": 5395, - "nt.lstat": 389, - "nt._getfinalpathname": 458 - }, - "completed_plans": 1 - }, - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 8, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "seed_wall_seconds": 1.3515385999926366, - "seed_cpu_seconds": 0.796875, - "validation_wall_seconds": 5.00293870002497, - "validation_cpu_seconds": 3.765625, - "reconcile_wall_seconds": 8.449291899974924, - "reconcile_cpu_seconds": 5.75, - "lock_wait_wall_seconds": 0.45186049985932186, - "registry_lock_held_wall_seconds": 8.407875600038096, - "current_plan_validation_wall_seconds": 1.6476713999873027, - "validation_engine": "native-shadow", - "index_experiment": { - "mode": "native-shadow", - "authoritative": "reference", - "preview_wall_seconds": 1.8662118999636732, - "reference_wall_seconds": 3.136588800000027, - "agreement": true, - "native_claims_checked": 8, - "preview_result": "accepted", - "native_projections": 1069, - "native_open_calls": 2007, - "native_information_calls": 1069, - "native_final_path_calls": 1069, - "native_handles_opened": 1069, - "native_handles_closed": 1069, - "reference_result": "accepted" - }, - "shadow_candidate_wall_seconds": 1.8662118999636732, - "reference_validation_wall_seconds": 3.136588800000027, - "registry_validations": 1, - "registry_scans": 2, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 1069, - "path_projections_total": 2103, - "validation_filesystem_calls": { - "nt.stat": 35822, - "nt.lstat": 2009, - "nt._getfinalpathname": 2138 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 64, - "current_plans": 1, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "seed_wall_seconds": 10.497204200015403, - "seed_cpu_seconds": 5.765625, - "validation_wall_seconds": 5.7248135000118054, - "validation_cpu_seconds": 4.359375, - "reconcile_wall_seconds": 5.898639599967282, - "reconcile_cpu_seconds": 4.46875, - "lock_wait_wall_seconds": 0.041007000021636486, - "registry_lock_held_wall_seconds": 5.870908299984876, - "current_plan_validation_wall_seconds": 4.599976819008589e-06, - "validation_engine": "native-shadow", - "index_experiment": { - "mode": "native-shadow", - "authoritative": "reference", - "preview_wall_seconds": 2.0492028000298887, - "reference_wall_seconds": 3.675467099994421, - "agreement": true, - "native_claims_checked": 64, - "preview_result": "accepted", - "native_projections": 1741, - "native_open_calls": 2963, - "native_information_calls": 1741, - "native_final_path_calls": 1741, - "native_handles_opened": 1741, - "native_handles_closed": 1741, - "reference_result": "accepted" - }, - "shadow_candidate_wall_seconds": 2.0492028000298887, - "reference_validation_wall_seconds": 3.675467099994421, - "registry_validations": 1, - "registry_scans": 2, - "recorded_plan_loads_in_validation": 128, - "path_projections_in_validation": 1741, - "path_projections_total": 1805, - "validation_filesystem_calls": { - "nt.stat": 40336, - "nt.lstat": 2965, - "nt._getfinalpathname": 3482 - }, - "completed_plans": 1 - }, - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 64, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "seed_wall_seconds": 8.916910199972335, - "seed_cpu_seconds": 4.921875, - "validation_wall_seconds": 27.40504320000764, - "validation_cpu_seconds": 22.453125, - "reconcile_wall_seconds": 29.590691499994136, - "reconcile_cpu_seconds": 23.875, - "lock_wait_wall_seconds": 0.26843130006454885, - "registry_lock_held_wall_seconds": 29.563866099982988, - "current_plan_validation_wall_seconds": 0.8520258999778889, - "validation_engine": "native-shadow", - "index_experiment": { - "mode": "native-shadow", - "authoritative": "reference", - "preview_wall_seconds": 9.197408800013363, - "reference_wall_seconds": 18.207503099984024, - "agreement": true, - "native_claims_checked": 64, - "preview_result": "accepted", - "native_projections": 7621, - "native_open_calls": 14663, - "native_information_calls": 7621, - "native_final_path_calls": 7621, - "native_handles_opened": 7621, - "native_handles_closed": 7621, - "reference_result": "accepted" - }, - "shadow_candidate_wall_seconds": 9.197408800013363, - "reference_validation_wall_seconds": 18.207503099984024, - "registry_validations": 1, - "registry_scans": 2, - "recorded_plan_loads_in_validation": 128, - "path_projections_in_validation": 7621, - "path_projections_total": 8655, - "validation_filesystem_calls": { - "nt.stat": 256686, - "nt.lstat": 14665, - "nt._getfinalpathname": 15242 - }, - "completed_plans": 11 - } - ], - "medians": [ - { - "retained_claims": 8, - "current_plans": 1, - "candidate": { - "seed_wall_seconds": 1.3629234000109136, - "seed_cpu_seconds": 0.734375, - "validation_wall_seconds": 0.6381476999958977, - "validation_cpu_seconds": 0.484375, - "reconcile_wall_seconds": 0.9638928000349551, - "reconcile_cpu_seconds": 0.59375, - "lock_wait_wall_seconds": 0.03132269997149706, - "registry_lock_held_wall_seconds": 0.9450623000157066, - "current_plan_validation_wall_seconds": 3.1999661587178707e-06, - "shadow_candidate_wall_seconds": 0.19492140004877, - "reference_validation_wall_seconds": 0.44041520002065226, - "registry_validations": 1, - "registry_scans": 2, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 229, - "path_projections_total": 293 - } - }, - { - "retained_claims": 8, - "current_plans": 11, - "candidate": { - "seed_wall_seconds": 1.3515385999926366, - "seed_cpu_seconds": 0.796875, - "validation_wall_seconds": 5.00293870002497, - "validation_cpu_seconds": 3.765625, - "reconcile_wall_seconds": 8.449291899974924, - "reconcile_cpu_seconds": 5.75, - "lock_wait_wall_seconds": 0.45186049985932186, - "registry_lock_held_wall_seconds": 8.407875600038096, - "current_plan_validation_wall_seconds": 1.6476713999873027, - "shadow_candidate_wall_seconds": 1.8662118999636732, - "reference_validation_wall_seconds": 3.136588800000027, - "registry_validations": 1, - "registry_scans": 2, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 1069, - "path_projections_total": 2103 - } - }, - { - "retained_claims": 64, - "current_plans": 1, - "candidate": { - "seed_wall_seconds": 10.497204200015403, - "seed_cpu_seconds": 5.765625, - "validation_wall_seconds": 5.7248135000118054, - "validation_cpu_seconds": 4.359375, - "reconcile_wall_seconds": 5.898639599967282, - "reconcile_cpu_seconds": 4.46875, - "lock_wait_wall_seconds": 0.041007000021636486, - "registry_lock_held_wall_seconds": 5.870908299984876, - "current_plan_validation_wall_seconds": 4.599976819008589e-06, - "shadow_candidate_wall_seconds": 2.0492028000298887, - "reference_validation_wall_seconds": 3.675467099994421, - "registry_validations": 1, - "registry_scans": 2, - "recorded_plan_loads_in_validation": 128, - "path_projections_in_validation": 1741, - "path_projections_total": 1805 - } - }, - { - "retained_claims": 64, - "current_plans": 11, - "candidate": { - "seed_wall_seconds": 8.916910199972335, - "seed_cpu_seconds": 4.921875, - "validation_wall_seconds": 27.40504320000764, - "validation_cpu_seconds": 22.453125, - "reconcile_wall_seconds": 29.590691499994136, - "reconcile_cpu_seconds": 23.875, - "lock_wait_wall_seconds": 0.26843130006454885, - "registry_lock_held_wall_seconds": 29.563866099982988, - "current_plan_validation_wall_seconds": 0.8520258999778889, - "shadow_candidate_wall_seconds": 9.197408800013363, - "reference_validation_wall_seconds": 18.207503099984024, - "registry_validations": 1, - "registry_scans": 2, - "recorded_plan_loads_in_validation": 128, - "path_projections_in_validation": 7621, - "path_projections_total": 8655 - } - } - ] - }, - "second_sample": { - "platform": "Windows", - "python": "3.12.9", - "timings_include_instrumentation": true, - "setup_method": "private locked initialization/reconciliation (issue #54 POC)", - "coordinator_sha256": { - "candidate": "8701f91a82a033aed9cfdb1909bcc135ecd695d56c84271e1f382e76c2b1348b" - }, - "implementation_files": { - "candidate": { - "ProtocyteOutputCoordinator.py": "8701f91a82a033aed9cfdb1909bcc135ecd695d56c84271e1f382e76c2b1348b", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "7225328f1059846be1508ceef675216ad942f7cc1b651a87080a0ff5ca7f0a5f" - } - }, - "samples": [ - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 64, - "current_plans": 11, - "layout": { - "targets_per_plan": 1, - "shared_build_root": false, - "existing_directories": false - }, - "seed_wall_seconds": 12.453965900000185, - "seed_cpu_seconds": 6.078125, - "validation_wall_seconds": 31.676921500009485, - "validation_cpu_seconds": 25.453125, - "reconcile_wall_seconds": 35.244973800028674, - "reconcile_cpu_seconds": 27.625, - "lock_wait_wall_seconds": 0.5206469999393448, - "registry_lock_held_wall_seconds": 35.15774579998106, - "current_plan_validation_wall_seconds": 1.5557207999518141, - "validation_engine": "native-shadow", - "index_experiment": { - "mode": "native-shadow", - "authoritative": "reference", - "preview_wall_seconds": 11.420584300009068, - "reference_wall_seconds": 20.253657999972347, - "agreement": true, - "native_claims_checked": 64, - "preview_result": "accepted", - "native_projections": 7621, - "native_open_calls": 14663, - "native_information_calls": 7621, - "native_final_path_calls": 7621, - "native_handles_opened": 7621, - "native_handles_closed": 7621, - "reference_result": "accepted" - }, - "shadow_candidate_wall_seconds": 11.420584300009068, - "reference_validation_wall_seconds": 20.253657999972347, - "registry_validations": 1, - "registry_scans": 2, - "recorded_plan_loads_in_validation": 128, - "path_projections_in_validation": 7621, - "path_projections_total": 8655, - "validation_filesystem_calls": { - "nt.stat": 256689, - "nt.lstat": 14665, - "nt._getfinalpathname": 15242 - }, - "completed_plans": 11 - } - ], - "medians": [ - { - "retained_claims": 64, - "current_plans": 11, - "candidate": { - "seed_wall_seconds": 12.453965900000185, - "seed_cpu_seconds": 6.078125, - "validation_wall_seconds": 31.676921500009485, - "validation_cpu_seconds": 25.453125, - "reconcile_wall_seconds": 35.244973800028674, - "reconcile_cpu_seconds": 27.625, - "lock_wait_wall_seconds": 0.5206469999393448, - "registry_lock_held_wall_seconds": 35.15774579998106, - "current_plan_validation_wall_seconds": 1.5557207999518141, - "shadow_candidate_wall_seconds": 11.420584300009068, - "reference_validation_wall_seconds": 20.253657999972347, - "registry_validations": 1, - "registry_scans": 2, - "recorded_plan_loads_in_validation": 128, - "path_projections_in_validation": 7621, - "path_projections_total": 8655 - } - } - ] - } - }, - "upgrade_review": { - "scope": "isolated Windows cross-version checks; no consumer registry accessed", - "legacy_public_revision": "a37bde7156f444a22f7ab9d42392c91adb54ad30", - "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", - "candidate_coordinator_sha256": "8701f91a82a033aed9cfdb1909bcc135ecd695d56c84271e1f382e76c2b1348b", - "unchanged_ast_methods_since_checkpoint": [ - "reconcile_set", - "_reconcile_locked", - "validate", - "publish", - "reset", - "_recover", - "_apply_pending", - "_publish_one", - "_initialize_claim_locked", - "_release_claim", - "_generation_lock", - "_publication_lock" - ], - "reference_validator_ast_unchanged_since_checkpoint": false, - "file_lock_ast_unchanged_since_checkpoint": true, - "passed_cases": 51, - "cases": [ - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "reference", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "reference", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "shadow", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "native-shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "native-shadow", - "reader": "old", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - } - ] - } -} diff --git a/docs/observation-mechanism-results.md b/docs/observation-mechanism-results.md deleted file mode 100644 index 96e1eb4..0000000 --- a/docs/observation-mechanism-results.md +++ /dev/null @@ -1,140 +0,0 @@ -# Fresh observation experiment and rejected handle lease - -The operation-wide observation proof and the under-30-second gate **have not -passed**. The index remains non-authoritative and disabled in normal use. This -experiment adds a bounded, fresh native path reader and tests a proposed handle -lease; it does not claim a safe cached-index replacement for the reference pass. - -## What was implemented - -`ProtocytePathObservation.py` provides an experimental Windows reader. Each call -opens an existing path with `NtCreateFile`, `FILE_OPEN` and `OBJ_DONT_REPARSE`, -checks the opened object's attributes, obtains its normalized path and closes -the handle before returning. Missing components are searched again on every -call. There is no filesystem-fact or negative-lookup cache, no watcher, no -persistent observation token and no topology freeze claim. - -Microsoft documents -[OBJ_DONT_REPARSE](https://learn.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_object_attributes) -as refusing reparse traversal. The reader avoids combining `FILE_DIRECTORY_FILE` -with flags outside the compatibility list in -[NtCreateFile](https://learn.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntcreatefile). -It requests attribute access, shares read/write/delete and never creates or -writes files. It supports ordinary absolute drive paths; unsupported namespaces -or platforms use reference validation. Ordinary I/O errors are not converted to -successful negative observations. - -The private `native-shadow` mode substitutes this reader into the existing -registry comparisons and record authentication, without removing the cross -product or fresh physical-ancestry checks. It then **always runs the ordinary -reference validator**. Native disagreement/errors fail closed if reference accepts; -reference rejection propagates. A known capability failure falls back to reference. -The native pass leaves abandoned-state cleanup to reference and never initializes -claims or reconciles outputs. Close failures also require reference verification -and cannot authorize initialization. - -The native API bindings can survive the phase; filesystem observations and -handles cannot. Counters explicitly include native opens, attribute/final-path -queries and successful handle closes, so opaque ctypes calls are not reported as -eliminated filesystem work. Benchmark fingerprints include all three helper files. - -## Why read-only handles do not prove operation-wide reuse - -A real Windows adversarial test held an ordinary directory open with -`FILE_READ_ATTRIBUTES`, allowing only read sharing. A second attribute-only -handle still converted that directory into a junction with -`FSCTL_SET_REPARSE_POINT`. The native observer rejected the changed path on its -next call. The counterexample passed on this host; it was not a simulated alias. - -This is consistent with Microsoft's -[sharing rules](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew), -which exclude attribute access from ordinary sharing restrictions, and the -[reparse operation specification](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fsa/4aeefef8-92c3-4abc-af7a-a610caf8a165), -which permits the operation through write-attributes access. Keeping existing -directory handles open is therefore insufficient to retain cached name/geometry -authority. Missing children also cannot be protected by an ordinary read handle. - -Directory-content oplock breaks remain advisory, as described in -[the initial contract](experimental-index-contract.md). USN journals are not a -drop-in proof either: reasons accumulate until close, so a complete protocol -must address existing open writers, forced posting, journal continuity and all -name/object dependencies. A bounded capability probe on this host could post a -close record for a new test directory, but a zero-access volume journal query -returned `ERROR_INVALID_FUNCTION`. No journal was created, resized or configured, -no elevation was requested for the application, and no journal-based authority -was implemented. These probe results do not establish availability on other hosts. - -## Measurements and stop decision - -The second measurement and the earlier four-case pilot are in -[observation-mechanism-results.json](observation-mechanism-results.json). Each -sample uses a fresh explicit synthetic registry and real locked fixture setup. -All timings include instrumentation and uncontrolled workstation/cache effects. - -At **64 retained claims / 11 current plans**: - -| Work | Pilot seconds | Second sample seconds | -| --- | ---: | ---: | -| Native fresh registry-validation phase | 9.197 | 11.421 | -| Mandatory reference registry-validation phase | 18.208 | 20.254 | -| Both registry phases | 27.405 | 31.677 | -| Separate current-plan validation | 0.852 | 1.556 | -| Complete reconciliation, including locks and output-state work | 29.591 | 35.245 | -| Separate fixture setup | 8.917 | 12.454 | - -Each sample retains its measured source fingerprints. After the second sample, -the explicit extended-path namespace was conservatively restricted to reference -fallback because stripping that prefix would change existing ownership-key -spelling. This capability restriction was tested separately; the timings above -are not relabeled as measurements of that final source snapshot. - -The native phase made **7,621 projections**, **14,663 opens**, **7,621 attribute -queries** and **7,621 final-path queries**. All **7,621 opened handles closed**. -Every one of the 64 retained claims/plans was authenticated in each relevant -phase. The full report retains both Python filesystem counters and native counters. - -This is a smaller fixture than the 2,172/11 target, already consuming most of the -30-second budget in shadow mode. The native phase still repeats work across the -claim/plan cross product. A size-only projection of 9.197 seconds to 2,172 claims -would be roughly 312 seconds for that phase, **not a measurement or a lower -bound**. This mechanism fails the research cost gate; it is not reasonable to -claim that a small native-API substitution solves the target. No authoritative -index mode or automatic promotion was added, and no large reference run was -performed merely to reproduce another several-minute failure. - -## Correctness and upgrade evidence - -- Default regression suite: **1,772 passed, 41 skipped**. -- Existing coordinator suite with native-shadow: **87 passed, 6 skipped**. -- New observation tests: **22 passed**, including real reparse conversion, - fresh missing/existing transitions, file/directory distinctions, scope expiry, - unexpected status/permission failures, handle cleanup, fallback, and rejection - before new claims after a foreign replacement. -- Minimum-version check on CPython 3.12.9: **48 passed** observation/index tests, - including an existing explicit-namespace claim retaining its token and record - through reference fallback. -- CMake integration: **18 passed, 1 skipped**, including both shadow modes from - an installed, relocated package with an unchanged prefix. -- **51 cross-version upgrade/rollback/recovery cases passed** against the exact - public protocol-v1 coordinator cited in #54, including native-shadow in both - directions. Claim tokens, plan digests and unchanged output bytes/mtimes survive; - publication, initialization and reset crash cuts recover across versions. - -The file-lock implementation and twelve mutation/recovery/lock methods remain -unchanged from preservation checkpoint `f804fd1`. The reference validator now has -an explicit reader adapter; default behavioral regressions and cross-version -tests verify that path rather than claiming its AST remains byte-for-byte equal. -Protocol v1, registry namespace, public CMake calls, generator/runtime and normal -user commands remain unchanged. The optional module installs next to the existing -helpers and needs no extra Python package, service or native helper build. - -## Remaining gate - -This work establishes a conservative fresh-observation primitive under reference -authority and disproves one proposed reuse mechanism. It does **not** establish -operation-wide observation validity. Promotion still requires an independently -reviewable dependency-lifetime/commit argument, adversarial tests for that exact -mechanism and repeated full-validation measurements below 30 seconds with margin. -A timestamp, two matching sweeps, read-sharing restrictions or a watcher cannot -substitute for that argument. Retaining correctness and easy upgrades takes -precedence over enabling the index. diff --git a/docs/parallel-probe-results.json b/docs/parallel-probe-results.json deleted file mode 100644 index 061a245..0000000 --- a/docs/parallel-probe-results.json +++ /dev/null @@ -1,2741 +0,0 @@ -{ - "date": "2026-11-16", - "branch": "codex/experimental-generation-engine", - "starting_commit": "8851bde", - "privacy": "anonymous retained consumer; raw manifests, paths, tokens, ledger copies, names and logs remain private", - "decision": { - "qualified_production_index": true, - "windows_default": "auto: indexed when verified; reference fallback otherwise", - "other_platform_default": "reference", - "all_validation_threshold_seconds": 30, - "formal_samples_below_threshold": 20, - "formal_samples_total": 20, - "failed_worker_retirement": "abort before mutation; reference cannot authorize the operation", - "new_runtime_dependencies": 0, - "required_consumer_configuration_changes": 0, - "protocol_version": 1, - "migration_or_token_rotation_required": false, - "force_reference_environment": "PROTOCYTE_REGISTRY_VALIDATION=reference", - "force_reference_cli": "--reference-registry-validation" - }, - "historical_log": { - "validation_seconds": 751.875, - "lock_wait_seconds": 0.328, - "reconciliation_seconds": 1.969, - "total_seconds": 754.172, - "registry_entries": 2172, - "current_plans": 11, - "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85" - }, - "workload": { - "registry_entries": 2239, - "ledger_records": 4478, - "current_plans": 11, - "targets_per_plan": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 - ], - "declared_outputs": 232, - "committed_output_files_checked": 232, - "claims_plans_snapshots_and_outputs_unchanged": true, - "snapshot_byte_identical": true, - "tokens_produced": 0, - "reconciliation_authorized": false, - "additional_claims_since_historical_run": 67, - "ntfs_volumes": 2, - "python": "3.12.9", - "windows_build": 26300, - "original_live_registry_and_locks": true, - "frozen_ledger_matches_previous_captures": true, - "fresh_process_per_sample": true, - "cold_os_cache_claimed": false, - "cache_or_security_settings_changed": false - }, - "implementation_files": { - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664", - "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4" - }, - "git_normalized_implementation_files": { - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664", - "ProtocyteOutputCoordinator.py": "88fbf0a18beab9b55a6efad4c8136bdc023834de149f7bced1715a09420948ca", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4" - }, - "source_normalization": { - "difference": "CRLF to LF only", - "files": [ - "ProtocyteOutputCoordinator.py" - ], - "all_four_ast_identical": true - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "pre_promotion_frozen_sources": { - "driver.py": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "legacy.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664", - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4" - }, - "promotion_changed_ast_nodes": [ - "OutputCoordinator", - "OutputCoordinator.__init__", - "_parse_arguments", - "main" - ], - "promotion_also_changed_constant": "_COMMITTED_INDEX_QUALIFIED: false to true", - "reference_and_mutation_methods_ast_unchanged_since_8851bde": [ - "FileLock", - "OutputCoordinator._validate_registry_reference", - "OutputCoordinator.reconcile_set", - "OutputCoordinator._reconcile_locked", - "OutputCoordinator.validate", - "OutputCoordinator.publish", - "OutputCoordinator.reset", - "OutputCoordinator._recover", - "OutputCoordinator._apply_pending", - "OutputCoordinator._publish_one", - "OutputCoordinator._initialize_claim_locked", - "OutputCoordinator._release_claim", - "OutputCoordinator._generation_lock", - "OutputCoordinator._publication_lock" - ], - "worker_bounds": { - "workers": 4, - "batch_size": 32, - "pending_batches": 8 - }, - "loaded_series": { - "concurrent_load": "two complete legacy/current reference oracles; original geometry, frozen ledger", - "summary": { - "samples": 10, - "all_below_30_seconds": true, - "wall_seconds": { - "minimum": 23.00330879999092, - "median": 25.671646850008983, - "maximum": 27.46123300003819 - }, - "cpu_seconds": { - "minimum": 23.53125, - "median": 25.265625, - "maximum": 27.890625 - }, - "wall_samples_seconds": [ - 23.973091199994087, - 24.29418959998293, - 25.78379189997213, - 26.71369559998857, - 23.00330879999092, - 25.767325000022538, - 23.424868099973537, - 25.57596869999543, - 27.21708569995826, - 27.46123300003819 - ] - }, - "runs": [ - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 23.973091199994087, - "validation_cpu_seconds": 24.625, - "plan_parse_seconds": 0.19016100000590086, - "lock_wait_seconds": 0.3572738000075333, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 22.669190000044182, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 720736, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 24.29418959998293, - "validation_cpu_seconds": 24.078125, - "plan_parse_seconds": 0.18650770001113415, - "lock_wait_seconds": 0.35033290000865236, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 22.786057799996343, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719936, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 25.78379189997213, - "validation_cpu_seconds": 25.03125, - "plan_parse_seconds": 0.15694999997504056, - "lock_wait_seconds": 0.3303153000306338, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 24.251038999995217, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 723296, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 26.71369559998857, - "validation_cpu_seconds": 26.375, - "plan_parse_seconds": 0.21843889995943755, - "lock_wait_seconds": 0.4049413000466302, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 24.73671980004292, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 721296, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 23.00330879999092, - "validation_cpu_seconds": 23.53125, - "plan_parse_seconds": 0.15729250002186745, - "lock_wait_seconds": 0.289165000023786, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 21.528132800012827, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 720256, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 25.767325000022538, - "validation_cpu_seconds": 25.890625, - "plan_parse_seconds": 0.16689880000194535, - "lock_wait_seconds": 0.3340180000523105, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 24.27530460001435, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 720736, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 23.424868099973537, - "validation_cpu_seconds": 23.546875, - "plan_parse_seconds": 0.1567716000135988, - "lock_wait_seconds": 0.35429909999947995, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 22.0976013999898, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 721296, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 25.57596869999543, - "validation_cpu_seconds": 25.5, - "plan_parse_seconds": 0.21324660000391304, - "lock_wait_seconds": 0.35866249998798594, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 24.06260609999299, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719696, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 27.21708569995826, - "validation_cpu_seconds": 27.375, - "plan_parse_seconds": 0.18327469995711, - "lock_wait_seconds": 0.3879172000451945, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 25.566524200025015, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719696, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 27.46123300003819, - "validation_cpu_seconds": 27.890625, - "plan_parse_seconds": 0.17828970000846311, - "lock_wait_seconds": 0.3499928999808617, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 25.817237599985674, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719616, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - } - ] - }, - "enabled_default_series": { - "experimental_override_used": false, - "summary": { - "samples": 10, - "all_below_30_seconds": true, - "wall_seconds": { - "minimum": 14.48910850007087, - "median": 14.977545249916147, - "maximum": 16.53801730007399 - }, - "cpu_seconds": { - "minimum": 21.828125, - "median": 22.7421875, - "maximum": 24.734375 - }, - "wall_samples_seconds": [ - 15.682767599937506, - 14.703003100003116, - 14.951474700006656, - 14.990504799876362, - 14.964585699955933, - 14.48910850007087, - 14.834491900051944, - 15.810676700086333, - 15.464098199969158, - 16.53801730007399 - ] - }, - "runs": [ - { - "mode": "default", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": true, - "result": "accepted", - "validation_seconds": 15.682767599937506, - "validation_cpu_seconds": 22.703125, - "plan_parse_seconds": 0.0621261999476701, - "lock_wait_seconds": 0.14858510007616132, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 15.157027599983849, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 718736, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "default", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": true, - "result": "accepted", - "validation_seconds": 14.703003100003116, - "validation_cpu_seconds": 22.140625, - "plan_parse_seconds": 0.05982149997726083, - "lock_wait_seconds": 0.1445179000729695, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 14.232881500036456, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 718496, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "default", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": true, - "result": "accepted", - "validation_seconds": 14.951474700006656, - "validation_cpu_seconds": 23.234375, - "plan_parse_seconds": 0.060894700000062585, - "lock_wait_seconds": 0.1492137999739498, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 14.485082200029865, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 721216, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "default", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": true, - "result": "accepted", - "validation_seconds": 14.990504799876362, - "validation_cpu_seconds": 22.78125, - "plan_parse_seconds": 0.05553379992488772, - "lock_wait_seconds": 0.10894590010866523, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 14.536531600053422, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 722656, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "default", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": true, - "result": "accepted", - "validation_seconds": 14.964585699955933, - "validation_cpu_seconds": 22.4375, - "plan_parse_seconds": 0.06457189994398504, - "lock_wait_seconds": 0.14129389997106045, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 14.485794099979103, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 718496, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "default", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": true, - "result": "accepted", - "validation_seconds": 14.48910850007087, - "validation_cpu_seconds": 21.828125, - "plan_parse_seconds": 0.06378590001258999, - "lock_wait_seconds": 0.1175462999381125, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 14.014995499979705, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719456, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "default", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": true, - "result": "accepted", - "validation_seconds": 14.834491900051944, - "validation_cpu_seconds": 21.90625, - "plan_parse_seconds": 0.057460400043055415, - "lock_wait_seconds": 0.11687989998608828, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 14.37316620000638, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719216, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "default", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": true, - "result": "accepted", - "validation_seconds": 15.810676700086333, - "validation_cpu_seconds": 24.734375, - "plan_parse_seconds": 0.055544600007124245, - "lock_wait_seconds": 0.15205200004857033, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 15.346964599913917, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719056, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "default", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": true, - "result": "accepted", - "validation_seconds": 15.464098199969158, - "validation_cpu_seconds": 23.578125, - "plan_parse_seconds": 0.061964399996213615, - "lock_wait_seconds": 0.1372508000349626, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 14.963044699979946, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 718576, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "default", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": true, - "result": "accepted", - "validation_seconds": 16.53801730007399, - "validation_cpu_seconds": 24.203125, - "plan_parse_seconds": 0.05571410001721233, - "lock_wait_seconds": 0.10686090006493032, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 16.084514199988917, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719536, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_worker_context_checks": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_native_retired": true, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - } - ] - }, - "preliminary_series": { - "included_in_formal_gate": false, - "summary": { - "samples": 3, - "all_below_30_seconds": true, - "wall_seconds": { - "minimum": 17.479689900006633, - "median": 17.873306899971794, - "maximum": 18.5645825000247 - }, - "cpu_seconds": { - "minimum": 21.8125, - "median": 22.71875, - "maximum": 23.625 - }, - "wall_samples_seconds": [ - 18.5645825000247, - 17.479689900006633, - 17.873306899971794 - ] - }, - "runs": [ - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "516ebaf90bd1abd475b66e487b721578d516589befe849a3b1b44697b4d48668", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "0f29248142e0d4eefbea834ec5f616e3d2a7dce0f280fe222b3a29b99dff2ed5" - }, - "qualification_driver_sha256": "e959178ea2880fdf0661db18be384aba23ae6ef1386e630ebf80a6308220d40b", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 18.5645825000247, - "validation_cpu_seconds": 23.625, - "plan_parse_seconds": 0.11295179999433458, - "lock_wait_seconds": 0.24943399999756366, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 17.635164300038014, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719536, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "516ebaf90bd1abd475b66e487b721578d516589befe849a3b1b44697b4d48668", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "0f29248142e0d4eefbea834ec5f616e3d2a7dce0f280fe222b3a29b99dff2ed5" - }, - "qualification_driver_sha256": "e959178ea2880fdf0661db18be384aba23ae6ef1386e630ebf80a6308220d40b", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 17.479689900006633, - "validation_cpu_seconds": 21.8125, - "plan_parse_seconds": 0.08638719998998567, - "lock_wait_seconds": 0.19532140000956133, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 16.81076399999438, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719616, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - { - "mode": "indexed", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "516ebaf90bd1abd475b66e487b721578d516589befe849a3b1b44697b4d48668", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "0f29248142e0d4eefbea834ec5f616e3d2a7dce0f280fe222b3a29b99dff2ed5" - }, - "qualification_driver_sha256": "e959178ea2880fdf0661db18be384aba23ae6ef1386e630ebf80a6308220d40b", - "index_authorization_enabled": false, - "result": "accepted", - "validation_seconds": 17.873306899971794, - "validation_cpu_seconds": 22.71875, - "plan_parse_seconds": 0.08108989999163896, - "lock_wait_seconds": 0.24072529998375103, - "current_plans": 11, - "registry_entries": 2239, - "original_live_registry_and_locks": true, - "native_metrics": { - "mode": "indexed", - "authoritative": "index", - "preview_wall_seconds": 17.10248960001627, - "reference_wall_seconds": 0.0, - "agreement": null, - "commit_claims_checked": 2239, - "commit_certificate": "verified", - "commit_reservations": 4486, - "commit_index_queries": 22, - "commit_fresh_comparisons": 84579, - "commit_open_calls": 30386, - "commit_info_calls": 58353, - "commit_negative_probes": 261703, - "commit_close_posts": 17958, - "commit_version_reads": 13457, - "commit_epoch_queries": 6, - "commit_journal_reads": 2, - "commit_journal_bytes": 719376, - "commit_witnesses": 8979, - "commit_records_read": 4478, - "commit_binding_checks": 12447, - "commit_record_read_calls": 8956, - "commit_record_seek_calls": 4478, - "commit_directory_enumerations": 8976, - "commit_full_inventory_scans": 2, - "commit_probe_state": "closed", - "commit_probe_workers": 4, - "commit_probe_threads": 4, - "commit_probe_active": 0, - "commit_probe_peak_active": 4, - "commit_probe_pending": 0, - "commit_probe_peak_pending": 8, - "commit_probe_batches_submitted": 2662, - "commit_probe_batches_started": 2662, - "commit_probe_batches_finished": 2662, - "commit_probe_comparisons": 84579, - "commit_state": "closed", - "commit_handles_opened": 26916, - "commit_handles_closed": 26916, - "commit_final_path_calls": 8979, - "preview_result": "accepted", - "reference_result": "not-required" - }, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - } - ] - }, - "reference_oracles": [ - { - "mode": "legacy", - "implementation_files": { - "driver.py": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "legacy.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664", - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4" - }, - "original_workload": true, - "frozen_sources": true, - "result": "accepted", - "registry_entries": 2239, - "claims_checked": 2239, - "validation_seconds": 934.7074909000075, - "validation_cpu_seconds": 661.359375, - "frozen_ledger": true, - "original_output_paths": true, - "original_namespace_checked_separately": true, - "live_shared_lock_held": false, - "ownership_or_output_mutations": 0 - }, - { - "mode": "reference", - "implementation_files": { - "driver.py": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "legacy.py": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664", - "ProtocyteOutputCoordinator.py": "52e1aae52d6f195e04b0b67e2fc8e7d8edffb418e9ac4f98a7e2e02fce1c2cee", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4" - }, - "original_workload": true, - "frozen_sources": true, - "result": "accepted", - "registry_entries": 2239, - "claims_checked": 2239, - "validation_seconds": 707.3523126000073, - "validation_cpu_seconds": 479.59375, - "frozen_ledger": true, - "original_output_paths": true, - "original_namespace_checked_separately": true, - "live_shared_lock_held": false, - "ownership_or_output_mutations": 0 - } - ], - "preservation": { - "mode": "audit", - "platform": "Windows", - "python": "3.12.9", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "qualification_driver_sha256": "a32a0a28f56d4a599820cda4a0a035d3c1f0f25c1e72c0680c74dee240a57714", - "index_authorization_enabled": true, - "registry_entries": 2239, - "committed_output_files_checked": 232, - "claims_plans_snapshots_outputs_and_mtimes_unchanged": true, - "ownership_or_output_mutations": 0, - "tokens_produced": 0 - }, - "comparisons": { - "exact_historical_baseline_seconds": 751.875, - "default_median_speedup": 50.20014878634464, - "default_median_percent_less_time": 98.00797403159885, - "approximate_700_second_baseline_speedup": 46.73663062402826, - "loaded_worst_speedup_over_exact_baseline": 27.379506229707687, - "controlled_algorithm_only_comparison": false - }, - "verification": { - "ci_test_portability_followup": { - "initial_head": "99c2a693731419a002ce5dc6f5b9a28a41526ba9", - "initial_failures": [ - "POSIX ENOTDIR rejection used an already fail-closed diagnostic outside the test regex", - "shallow CI checkout lacked the pinned historical helper revision" - ], - "fixes": [ - "accept the existing POSIX rejection diagnostic in the ancestor-replacement test", - "fetch history in plugin CI to run the real pinned-helper compatibility test" - ], - "production_implementation_bytes_changed": false, - "cmake_only_test_parallelism": "quiet-observer test gate applies to integration cases only when quiet native cases are selected", - "selection_checks": { - "quiet_native_only": true, - "cmake_only": false, - "mixed_native_and_cmake": true - }, - "mixed_native_cmake_run": { - "passed": 168, - "skipped": 1, - "seconds": 100.49 - }, - "cmake_only_parallel_run": { - "pytest_workers": 4, - "passed": 22, - "skipped": 1, - "seconds": 35.91 - } - }, - "final_source_passes": [ - { - "check": "Ruff: all touched Python source and tests", - "passed": true - }, - { - "check": "CPython 3.14.4 complete default suite, four pytest processes", - "passed": 1927, - "skipped": 41 - }, - { - "check": "Explicit indexed coordinator suite", - "passed": 89, - "skipped": 6 - }, - { - "check": "Minimum Python 3.12.9: parallel, native, qualifier, ownership and path tests", - "passed": 201 - }, - { - "check": "CMake packaging and integration", - "passed": 22, - "skipped": 1 - }, - { - "check": "Python 3.12.9 cross-version upgrade, rollback and crash recovery", - "passed": 111 - } - ], - "cross_version_upgrade": { - "scope": "isolated Windows cross-version checks; no consumer registry accessed", - "legacy_git_blob": "25f1660190d3d1015fef3955814c8c737bd686c5", - "legacy_coordinator_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", - "candidate_coordinator_sha256": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "implementation_files": { - "ProtocyteOutputCoordinator.py": "8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10", - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "candidate_helper_sha256": { - "ProtocyteOwnershipIndex.py": "7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38", - "ProtocytePathObservation.py": "a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4", - "ProtocyteObservationCommit.py": "143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664" - }, - "unchanged_ast_methods_since_checkpoint": [ - "reconcile_set", - "_reconcile_locked", - "validate", - "publish", - "reset", - "_recover", - "_apply_pending", - "_publish_one", - "_initialize_claim_locked", - "_release_claim", - "_generation_lock", - "_publication_lock" - ], - "reference_validator_ast_unchanged_since_checkpoint": false, - "file_lock_ast_unchanged_since_checkpoint": true, - "passed_cases": 111, - "production_index_authorization_qualified": true, - "index_authority_enabled_only_in_isolated_fixture_module": false, - "indexed_validations": 32, - "index_authorized_validations": 30, - "indexed_reference_fallbacks": 2, - "cases": [ - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "reference", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "reference", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "shadow", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "native-shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "native-shadow", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "commit-shadow", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "commit-shadow", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "indexed", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "indexed", - "reader": "old", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "old", - "reader": "default", - "passed": true - }, - { - "kind": "upgrade-rollback-noop-token-and-publication", - "writer": "default", - "reader": "old", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "reference", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "native-shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "native-shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "commit-shadow", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "commit-shadow", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "indexed", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "indexed", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "old", - "reader": "default", - "cut": "after-reset-disposable", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-pending", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-output-1", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-output-2", - "passed": true - }, - { - "kind": "publication-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-initial-snapshot", - "passed": true - }, - { - "kind": "initialization-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-claim", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-reset-intent", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-reset-output-1", - "passed": true - }, - { - "kind": "reset-crash-recovery", - "writer": "default", - "reader": "old", - "cut": "after-reset-disposable", - "passed": true - } - ] - }, - "parallel_probe_tests": 64, - "randomized_serial_parallel_differential_cases": 1024, - "test_case_serialization": "when quiet native cases are selected, native and CLI/integration cases share a test-only mutex; CMake-only runs retain process parallelism and intentional concurrency inside every case is preserved", - "cpp_files_touched": 0 - }, - "limits": [ - "Target-workload qualification on one Windows/NTFS host, not a universal latency or platform-matrix guarantee.", - "Fresh processes reuse the workload and OS caches; no cold-cache guarantee.", - "Whole validation includes current-plan parsing, complete retained-record authentication, both-direction fresh comparisons, inventories, witnesses, worker retirement and native-handle release.", - "Registry/generation/publication lock wait is separate; observer mutex wait is included in validation.", - "Live qualification forbids reconciliation/publication/reset and creates no tokens; mutation behavior is qualified in isolated upgrade/integration tests.", - "USN witness posting changes counted journal metadata, not ownership records, file contents or names.", - "Capability, witness, namespace, alias, resource-budget or ordinary comparison failure after safe cleanup runs full reference validation and can exceed 30 seconds.", - "Failed worker retirement aborts the operation before mutation, preserving bindings until native retirement is proved.", - "No atomic namespace freeze or guarantee against noncooperative record writers; existing mutation-time checks and v1 writer locks remain necessary." - ] -} diff --git a/docs/parallel-probe-results.md b/docs/parallel-probe-results.md deleted file mode 100644 index 9f3deb6..0000000 --- a/docs/parallel-probe-results.md +++ /dev/null @@ -1,219 +0,0 @@ -# Parallel-probe qualification - -Historical qualification at `1d1e1b0`. The subsequent -[MR review](mr55-review-results.md) fixed correctness and upgrade issues, then -failed the repeat timing gate. **The current source gate is closed and the -default is reference validation.** The initial enablement described below is -preserved as historical evidence. - -**Passed: 20/20 complete validations below 30 seconds.** The experimental -branch now automatically uses the committed index on qualified Windows -invocations. The enabled default took **14.489–16.538 seconds**, with a -**14.978-second median**. Ten additional samples while two complete reference -oracles ran concurrently took **23.003–27.461 seconds**. Every sample accepted -the entire retained workload with verified end witnesses, fully retired workers, -balanced native handles, and no reference fallback. - -The default median is **50.20 times faster (98.01% less time)** than the -exact historical **751.875-second validation**, or -**46.74 times faster** than an approximate 700-second baseline. -These compare distinct observed runs, not controlled estimates of the algorithm -alone. They do not include reconciliation or promise the same latency on every -host. The previous [serial timing gate](consumer-validation-results.md) remains -recorded as a failure; these results come from a new parallel implementation. - -## Complete workload and measurement boundary - -This is the original anonymous consumer configuration, with **11 current plans**, -one target each, **232 generated files**, **2,239 retained claims**, and -**4,478 claim/plan records** on two NTFS volumes. The historical log had 2,172 -claims: all 67 additional claims remain present. No registry was pruned, split, -reset, replaced, or moved to a new lock namespace. Frozen ledger hashes match -the previous qualification captures exactly. - -Each live sample uses CPython 3.12.9 on Windows build 26300 in a fresh process, -acquires the original registry/generation/publication locks, parses the original -current plans, checks their complete plan set, and runs the production registry -validation entry point. The timer includes those plan checks, every retained -record, index construction, fresh directional negative probes, inventories, -name bindings, versions, exact close witnesses, worker retirement, and native -handle release. Registry/generation/publication lock wait is reported separately; -observer-mutex wait is included. OS caches and the workload are reused. No -cold-cache claim is made, and no cache or security settings were changed. - -The first formal series kept the source promotion guard closed: only the -mutation-forbidden qualification module enabled its own indexed entry point. -After that series passed, the enabled-default series used the actual default -constructor and source guard, without an experimental flag or qualification -override. All twenty samples exercised production validation code. The harness -forbids reconciliation, recovery, publication, reset, and durable record writes; -it issues no tokens. Mutation behavior is tested separately in isolated builds. - -## All formal samples - -| Sample | Loaded validation | Enabled default | Default CPU | -| --- | ---: | ---: | ---: | -| 1 | 23.973 s | 15.683 s | 22.703 s | -| 2 | 24.294 s | 14.703 s | 22.141 s | -| 3 | 25.784 s | 14.951 s | 23.234 s | -| 4 | 26.714 s | 14.991 s | 22.781 s | -| 5 | 23.003 s | 14.965 s | 22.438 s | -| 6 | 25.767 s | 14.489 s | 21.828 s | -| 7 | 23.425 s | 14.834 s | 21.906 s | -| 8 | 25.576 s | 15.811 s | 24.734 s | -| 9 | 27.217 s | 15.464 s | 23.578 s | -| 10 | 27.461 s | 16.538 s | 24.203 s | - -Loaded median: **25.672 seconds**. Default CPU median: -**22.742 seconds**, range **21.828–24.734**. -Parallelism spends additional CPU to reduce elapsed time. The earlier paired -prototype measured 22.266 CPU seconds in parallel versus 18.500 serial; that -historical pair is feasibility evidence, not a controlled comparison for the -hardened implementation. Three preliminary hardened-development samples -(18.565, 17.480, 17.873 seconds) are retained in the JSON, excluded from the -formal twenty-sample gate because the native helper was subsequently hardened. - -Every formal sample retains the following work: - -| Check | Count per validation | -| --- | ---: | -| Authenticated claim/plan records | 4,478 | -| Fresh reservation comparisons | 84,579 | -| Fresh negative probes | 261,703 | -| Full registry inventories | 2 | -| Forced close posts / exact end witnesses | 17,958 / 8,979 | -| Native handles opened / closed | 26,916 / 26,916 | -| Worker batches submitted / started / finished | 2,662 / 2,662 / 2,662 | -| Worker / pending-batch peaks | 4 / 8 | -| Active / pending work at return | 0 / 0 | - -## Independent acceptance and preservation - -Both complete reference oracles accepted all 2,239 claims: the exact historical -coordinator took **934.707 seconds**, and the branch reference validator took -**707.352 seconds**. They ran concurrently with each other and the loaded native -series. These elapsed times describe reader contention, not controlled speedup -ratios. The slow oracles validate byte-identical ledger copies captured under -the original locks, retain the original build/output/staging geometry, filter -no foreign records, and separately execute original lock-namespace checks. They -do not hold the live shared registry lock for their long reference passes. - -The post-series audit verified unchanged original claim/plan bytes, current -snapshots, and all **232 generated-file hashes and mtimes**. No ownership/output -mutation, reconciliation, publication, reset, or token creation occurred in live -qualification. Native observation still posts counted USN journal metadata; -it does not alter file contents or names. Raw paths, names, ledger copies, -tokens, manifests, and logs remain in ignored local evidence. - -## Scheduling and correctness - -The owner authenticates records and freezes all prepared endpoint views before -creating work. Four workers perform independent comparisons in batches of 32, -with at most eight pending batches, preserving result order. Workers cannot -register paths, collect geometry, or mutate the read-set maps. Missing endpoints -are still freshly checked in both comparison directions and during sealing. -No negative result is cached as stable. Counters use explicit synchronization. - -An admission gate covers even a task queued by a failing submission. Cleanup -closes admission and drains admitted native work before executor cancellation -and joining. The retirement fence is independently required before erasing -views, closing root handles, or sealing. Worker, submission, shutdown, -and interruption failures have explicit tests. Unproved retirement -retains bindings and aborts before any reference result can authorize mutation. - -Index authority requires every positive USN witness, complete inventory/name -checks, fully closed native handles, a retired pool with zero pending/active -work, and exact comparison accounting. The [contract](observation-commit-contract.md) -retains the positive-version argument, noncanonical/case-sensitive alias -boundaries, fresh-negative semantics, and cooperative-writer assumptions. - -## Final-source qualification - -| Check | Result | -| --- | --- | -| Complete CPython 3.14.4 suite, `pytest -q -n 4` | 1,927 passed, 41 skipped | -| Explicit indexed coordinator suite | 89 passed, 6 skipped | -| Minimum CPython 3.12.9 native/index/parallel/qualifier tests | 201 passed | -| CMake packaging and integration | 22 passed, 1 skipped | -| Old/new upgrade, rollback, publication, crash recovery | 111 passed | -| Ruff on touched Python files | Passed | -| Mixed native/CMake run after narrowing the test gate | 168 passed, 1 skipped | -| CMake-only run with four pytest workers | 22 passed, 1 skipped; 35.91 seconds | - -The parallel suite contains 64 tests, including 1,024 randomized serial/parallel -ownership and retirement comparisons; all batch boundaries; real simultaneous -workers; reverse-direction file/dangling-junction races; real caller -impersonation; uncertain/emulated process contexts; late/untracked submission; -worker/shutdown/wait interruptions; preserved bindings when retirement is -unproved; incomplete certificates; previous-helper fallback; and token -preservation. Existing native ABA, alias, metadata, malformed-record, -concurrency, crash-cut and packaging checks remain in the full qualification. - -The first Linux CI pass identified two test portability assumptions: POSIX may -reject a replaced ancestor with `ENOTDIR` before the explicit parent-type check, -and shallow checkouts lack the pinned older-helper revision. The rejection test -now accepts that existing fail-closed diagnostic, and plugin CI fetches history -to execute the actual historical compatibility test. Production implementation -bytes and all timing/source fingerprints are unchanged by these test fixes. - -When a run includes quiet native cases, those cases and default-enabled -CLI/integration cases share a test-only mutex so their own USN markers do not -invalidate each other on common volume ancestors. CMake-only runs keep their -ordinary process parallelism. Deliberate threads/processes inside each case -remain concurrent. This does not replace or alter production ownership locks. One -test-harness race in the injected-wait handshake was corrected to wait for -the actual injected interruption before releasing the blocked worker. - -## Upgrades and failure boundaries - -Existing CMake commands keep working. Packaging installs the trusted sibling -helpers; no service, administrator setup, new Python dependency, registry -migration, reset, or claim-token rotation is required. The shared v1 lock -namespace, records, plan format, publication and recovery protocol stay the -same. All 111 cross-version checks use the final enabled source, including -old/default and default/old operation and crash recovery. Core mutation and -lock methods are AST-identical to the preservation checkpoint. The prior -recorded-plan `lstat` correctness fix still rejects malformed/dangling or -unreadable state rather than silently skipping it; valid ledgers need no repair. - -Automatic indexed validation requires native 64-bit Windows process context, -ordinary non-impersonating execution, local NTFS DOS paths, an existing usable -journal, exact supported observations, and the resource budgets in the contract. -Other platforms and unsupported capabilities use reference. Namespace changes, -aliases, dirty/missing witnesses, journal churn, external marker collisions, -and ordinary comparison failures after safe cleanup also use full reference -validation, which can exceed 30 seconds. Failed worker retirement aborts before -mutation. A broken native certificate never licenses an indexed acceptance. - -To force reference validation in an existing build, set -`PROTOCYTE_REGISTRY_VALIDATION=reference` in its environment; direct coordinator -commands also accept `--reference-registry-validation`. No configuration is -needed for normal use. Partial/mixed helper installations safely fall back -when their trusted API cannot supply the required complete certificate. - -This is evidence for the retained workload and tested Windows/NTFS host. -It does not prove a universal bound under cold caches, all filesystem filters, -or arbitrary machine load. Observation certifies past positive intervals, not -a namespace freeze or future stability. The existing cooperative-writer trust -model and mutation-time checks remain necessary. - -## Source provenance - -Qualification started at `8851bde`. The frozen pre-promotion native helper is -byte-identical to the enabled helper. Promotion changed automatic selection, -the qualification constant, and CLI default wiring in the coordinator; -its reference validator, lock class, and mutation methods are AST-identical -to the frozen oracle and starting checkpoint. Full final-source tests and the -enabled-default timing series ran after promotion. - -| Final implementation | As-run SHA-256 | -| --- | --- | -| `ProtocyteObservationCommit.py` | `143cd5e26bc25aafd848e7cc79df6d1d9d99793481aa5600df4d0541432d4664` | -| `ProtocyteOutputCoordinator.py` | `8646c014f9b5537f47dcccada60f7df6935043ed6a8c70c2f65f830307f78b10` | -| `ProtocyteOwnershipIndex.py` | `7df8626756210f8dd0694bf26ffb7364f6c638f6361d14e61ef6c48df23dfd38` | -| `ProtocytePathObservation.py` | `a745ea87565dab8b7ff0883d72a3d781854f3b88139d2ffc37052715de0bf1e4` | - -The [machine-readable report](parallel-probe-results.json) retains every formal -run and counter, the preliminary samples, reference receipts, preservation -audit, final upgrade receipt, frozen oracle fingerprints, and Git-normalized -source hashes. Normalization changes CRLF to LF only, with identical ASTs. diff --git a/docs/registry-validation-30s-plan.md b/docs/registry-validation-30s-plan.md deleted file mode 100644 index f43558d..0000000 --- a/docs/registry-validation-30s-plan.md +++ /dev/null @@ -1,175 +0,0 @@ -# Assessing a 30-second validation target - -## What has actually been reproduced - -There is a scalable, explicitly isolated synthetic reproduction of the same -registry-validation bottleneck. There is **not** a measured synthetic run that -matches the reported 751.875 s consumer observation exactly. - -| Case | Retained claims | Current plans | Validation | Status | -| --- | ---: | ---: | ---: | --- | -| Public issue #54 consumer observation | 2,172 | 11 | 751.875 s | Reported observation; consumer registry not accessed here | -| Earlier large synthetic run | 1,024 | 11 | 220.612 s | Measured on the first issue-54 implementation, Python 3.14.4 | -| Same synthetic shape at 2,172 claims | 2,172 | 11 | About 468 s | Simple size extrapolation of the preceding row, **not a measurement** | - -The final small refinement did not establish an additional wall-time speedup. -The large measurement and extrapolation must not be relabeled as final-code -large-run results. Setup for the 1,024-claim case took another 136.632 s and is -excluded from validation. - -An exact-size synthetic baseline can already be run from the repository root: - -```powershell -py -3.12 -B tests/benchmark_output_registry.py --large --claims 2172 --plans 11 --repeat 1 --work .pytest-tmp/registry-2172-baseline -``` - -The workspace must not exist. Fixture setup and validation can take minutes on -the current algorithm. Every sample has a new private registry and uses real -locked initialization/reconciliation helpers; measured validation skips no -checks. Publish only sanitized results, never fixture directories. - -This fixture has one target/output per plan, distinct synthetic build directories, -and initially absent output/staging directories. Equal claim/plan counts do not -make it a calibrated consumer-equivalent workload. Existing/missing roots, -targets per claim, shared build identities, directory depth and record sizes -must also be covered using anonymous layouts. We should not add artificial work -just to make a baseline last 750 seconds. - -## Required improvement and remaining cost - -751.875 s to under 30 s requires **more than 25x** improvement. Even the rough -468 s synthetic projection would need approximately **16x**. Changing locks or -replacing individual stat APIs does not address that scale of work. - -The one-target synthetic cases currently perform approximately -`117 * retained_claims + 133` path projections during registry validation when -there are eleven current plans and at least one retained claim. This matches -the observed 119,941 projections at 1,024 claims and predicts about 254,257 at -2,172 claims. This is an operation-count inference, not a new large measurement. - -A new bounded phase profile on **CPython 3.12.9** checked 64 retained claims -against eleven plans. Setup was separate; every retained claim/plan was checked. -The disjoint outermost function timers measured: - -| Registry-validation work | Seconds | Share | -| --- | ---: | ---: | -| Direct overlap comparisons and repeated current-root keying | 6.634 | 87.8% | -| Claim JSON/path authentication and complete recorded-plan authentication | 0.871 | 11.5% | -| Remaining work | 0.055 | 0.7% | -| Total registry validation | 7.560 | 100% | - -The authentication row includes its nested filesystem checks and plan parsing; -it is **not** just JSON decoding. Nested costs are not counted again in the -comparison row. The scan authenticated all 64 recorded plans, made 2,860 direct -overlap comparisons and derived 704 current-root keys. Lock preparation/acquisition -was 0.143 s, separately from validation. Current-plan validation was 0.399 s. - -Simply extrapolating the authentication row to 2,172 claims gives about **29.6 s** -before the new conflict algorithm or its freshness checks. That is a descriptive -estimate from one instrumented run, not a lower bound or timing guarantee. -Nevertheless, it shows why optimizing only the cross product is insufficient: -record authentication must also stop repeatedly projecting the same paths. - -The reproducible profiler is `tests/profile_output_registry.py`: - -```powershell -py -3.12 -B tests/profile_output_registry.py --claims 64 --plans 11 --work .pytest-tmp/registry-phase-profile -``` - -It delegates every operation unchanged, verifies one authentication per retained -record, restores its wrappers, and writes path-free metrics. Results for this -assessment are in [registry-validation-feasibility.json](registry-validation-feasibility.json). -All these timings include instrumentation and uncontrolled workstation/cache -effects; use counts and matched baseline/candidate runs for acceptance. - -## Architecture needed for an order-of-magnitude reduction - -The recommended research direction is a **transient ownership index with an -explicit filesystem-observation/commit contract**, plus record-authentication -refactoring. This is a proposed design to prove, not permission to enable broad -caching under the existing per-comparison freshness contract. - -1. **Separate record decoding from filesystem authority.** Split the work now - coupled in `_load_recorded_plan`, `Plan.from_payload`, `_claim_paths`, - `_require_plan_claim_binding` and `_validate_staging_path`. Read every record, - validate every shape/digest/ownership binding and keep the registry lock. - Authenticate path-dependent identities from an explicit observation object - rather than recursively projecting root/build/staging paths again. Immutable - JSON can be retained under the existing registry-lock contract; filesystem - observations need a separate, justified lifetime. -2. **Index all root and staging reservations.** Index canonical lexical prefixes, - physical directory/ancestor identities and missing-suffix relationships, - including owner/build/target metadata. Lookup must cover containment in both - directions, aliases of missing ancestors, and the existing retirement/same-owner - exceptions. Every retained claim still participates. A lexical-only path trie - cannot substitute for physical identity checks. -3. **Move filesystem work out of the claim × plan loop.** Build the index from - bounded observations and perform conflict queries against the current plans. - Aim for metadata work proportional to unique paths/components and necessary - revalidation passes, rather than repeatedly walking ancestors per pair. - The desired normal-case shape is approximately `O(unique path components + - reservations + current-plan lookups)`, with appropriate indexing overhead. - Even linear passes will fail the target if the old repeated authentication - walks remain inside them. -4. **Prove the observation boundary before production use.** This is the difficult - step. A registry lock protects cooperating record writers, not arbitrary - external renames, reparse changes or creation of formerly missing components. - An indexed negative conflict result can become stale through a foreign path, - even if the current output root itself is freshly checked. The design must - identify every dependency, invalidate/rebuild on changed bindings and freshly - validate authority before mutation. Two matching metadata sweeps, a timestamp, - a registry version or a filesystem watcher alone are not proof that topology - remained unchanged. Any handle/identity-based scheme still needs a proof of - the relationship between those objects, their names and missing components. -5. **Retain mutation-time protections.** Claim initialization, recovery, - retirement, reset and publication must keep their existing ownership and - topology checks. Do not carry an index through released locks or mutations. - Changes must fail closed with bounded recovery/retry behavior. If a safe - invalidation scheme requires returning to the full cross product, the proposed - design has failed its performance objective and must not be advertised as a - solution. - -This could cut hundreds of thousands of repeated projections to a small number -of passes over thousands of distinct locations and their shared ancestors. That -is enough algorithmic headroom to make 30 seconds plausible. It is **not yet a -safety-proven design or a demonstrated 30-second result**. Under the unchanged -rule that each pair performs fresh full walks, there is no evidence that local -tuning can produce the required 16–25x improvement. - -## Finite next phase and acceptance - -1. Freeze one exact-size 2,172/11 synthetic baseline and representative anonymous - layout variants. Define the target as **all validation work under 30 s**, - including record I/O/authentication, geometry checks, conflict queries and - any required fresh revalidation. Keep fixture setup, lock waiting and output - reconciliation separately reported. -2. First prototype only record authentication and linear geometry observation - under a written consistency contract. Measure 64 and 256 claims, plus operation - counts. Budget the full 2,172/11 validation at less than 25 s to leave margin. - If minimum safe observation/authentication work already consumes that budget, - stop and revise the architecture before implementing the full index. -3. Prove race/alias behavior with injections between observation, lookup, - precommit revalidation and actual mutations. Include foreign-path replacement, - missing-component creation, ancestor replacement, ABA-style changes, Windows - case/short-name aliases, links/junctions, concurrent writers and crash recovery. - Existing passing tests are necessary but not a proof of the new lifetime model. -4. Add the ownership index only after the safety argument is reviewable. Require - operation growth close to the number of reservations/unique components when - moving through 64, 256, 1,024 and 2,172 claims with eleven plans. Require every - record to remain authenticated and no lost overlap/ownership rejection. -5. Run the exact-size case and representative layout cases with the final design. - Report first-process and repeated-process samples honestly; a fresh process - does not imply a cold OS filesystem cache. Claim the target only from measured - results on the stated environment, with instrumentation overhead disclosed. - -Lock-wait convoy improvements can be pursued separately with the compatible -release/retry protocol discussed in [the locking review](registry-validation-refinements.md#locking-assessment). -They help unrelated writers under contention but cannot remove 750 seconds of -active validation work. Clearing retained claims, dropping physical checks, -changing the shared namespace or relaxing safety to meet a timing gate are not -part of this plan. - -This feasibility assessment preceded the implementation. A subsequent -[ownership-index experiment](experimental-index-results.md) measured the -read-only sampled phase at the exact claim/plan count. Its shadow mode retains -fresh reference authority; it has not achieved safe under-30-second validation. diff --git a/docs/registry-validation-design.md b/docs/registry-validation-design.md deleted file mode 100644 index fe1f904..0000000 --- a/docs/registry-validation-design.md +++ /dev/null @@ -1,139 +0,0 @@ -# Registry validation follow-up (#54) - -## Analysis and proposal (before coordinator changes) - -The current checkout includes #52: `reconcile_set` scans the registry once and -authenticates each retained claim/configured plan once, rather than once per -current plan. The remaining confirmed cost is the retained-claim/current-plan -cross product in `_validate_registry`, including root/root, staging/root, -root/staging and staging/staging comparisons. Every comparison projects both -paths and performs physical containment in both directions. Missing suffixes -are repeatedly searched for an existing ancestor; `samefile` adds two following -stat calls per ancestor beside the non-following identity checks. JSON loading, -current-plan all-pairs validation, lock waiting, reconciliation and fixture -setup are separate costs. Reported consumer timing is evidence of validation -cost, not proof that every metadata call is redundant or that claims leaked. - -### Ownership and locks - -A physical output root has an immutable claim (root/build identities and token), -a configured plan (targets, staging reservations and outputs), a committed -snapshot (generation and output digests), and possibly durable pending intent. -Publication recovers pending work by rolling forward. Initialization publishes -the snapshot before the claim. Reset authenticates ownership, persists absence -of owned outputs, and only then releases the claim. Empty plans and missing build -directories do not release ownership. Test-looking names and age are not proof -that a claim is disposable; this change will not prune retained claims. - -Reconciliation takes registry, then sorted generation, then sorted publication -locks, retaining them through plan commits. Reset takes the same ordering for -one root. Generation holds its root generation lock; publication/validation -take the publication lock. Claim/plan writers serialize via registry; payload -writers serialize via publication. Keep these lifetimes and the shared namespace. -Reducing validation time reduces registry-lock occupancy without moving checks -outside the lock or introducing a writer race. - -Locks do not freeze arbitrary filesystem topology. Projection rejects links, -junctions and non-directory ancestors, resolves Windows case/short spellings, -and appends a normalized missing suffix. Physical identity checks catch aliases -that lexical containment cannot see, including aliases of existing ancestors of -missing paths. File/directory, ancestor and reparse replacements can occur after -projection or between comparisons. The existing comment forbidding reuse across -comparisons is a safety contract, not an invitation to operation-wide caching. -Neither the existing nor proposed path API provides an atomic filesystem -snapshot against arbitrary external writers; mutation-time checks remain vital. - -### Recommended bounded change - -Keep the complete claim/current-plan cross product and two fresh projections -per `_paths_overlap`. Replace repeated physical ancestor searches with a local -physical ancestry observation in `_projected_physically_contains`. Observe each -component with non-following metadata, reject links/non-directories, identify -ordinary directories by device/inode (the same identity relation as `samefile`), -and represent missing descendants by that identity plus case-folded suffixes. -Compare the parent's location key against the child's ancestor keys. No -observations escape that single directional comparison. Retain the separate -reverse comparison and all projection, claim binding and mutation-time checks. -This reduces physical metadata work from quadratic in missing depth to linear in -total depth and removes following stat probes duplicating ordinary-directory -identity. Constructing all missing-suffix tuple prefixes still has quadratic -worst-case Python copying cost in missing depth; filesystem probes are linear. -For bounded targets/depth the registry remains O(claims * current plans), with -lower filesystem work; no sublinear registry-scaling claim is intended. - -If measurements show projection dominates, assess its repeated metadata walks -separately; do not combine observations across comparisons to meet a timing goal. -The initial implementation surfaces are physical containment helpers, progress, -focused regression tests and the reusable benchmark. - -Alternative: an operation-wide identity index could reduce projections toward -O(claims + plans), but external changes can invalidate a negative conflict lookup -without touching registry records. Fresh revalidation could restore the cross -product, while watcher-based invalidation is platform-specific and incomplete. -A durable ownership index also requires migration/crash recovery and does not -solve topology invalidation. Those are separate designs, not this bounded fix. -Pure lexical filtering is unsafe for physical aliases. No registry observations -will be reused across pairs, lock acquisitions, mutations, or publication. - -Reconciliation must still freshly derive state/lock keys, authenticate claims and -plans, recover snapshots and validate output/staging topology before mutation. -Publication retains its own current-plan, payload, containment, destination and -transaction checks; no optimization token grants later filesystem authority. - -### Progress, isolation and acceptance - -Continue path-free phase/count/timing reports at five-second frequency for the -whole operation. Bound frequency rather than total report count; retain silence -for fast operations, completion/failure reports and clean stdout claim tokens. -Remove the lifetime cap; adapt the POC's progress metadata to report no cutoff -when that constant is absent. Leave its measured reconciliation method intact. - -Direct coordinator tests already pass explicit temporary lock roots. CMake -ownership fixtures choose temporary `output-locks`; inspect other integration -fixtures before running them. Benchmarks must use a new explicitly isolated -registry for every sample. Keep synthetic records untracked because they contain -local paths. Only sanitized scripts, counts and timing summaries are deliverables. - -Acceptance: existing adversarial/recovery/concurrent-writer tests pass; add -bounded-depth operation-count coverage, aliases of missing ancestors, replacement -after projection and between comparisons, and progress past the former cutoff. -Run the issue's unchanged measured `reconcile_set((), current)` POC matrix -(0/8/16 claims, 1/11 plans) before/after. Count filesystem calls as well as time; -keep setup separate. Adapt only the POC progress metadata if necessary, preserving -the production measurement unchanged. Extend the maintained benchmark to allow -thousands of claims with explicit opt-in and linear private fixture seeding using -real locked initialization/reconciliation, as in the issue POC. First run 64/11; -then cap larger work at one 1,024/11 sample if projected runtime is reasonable. -Do not run the old quadratic seeding path at thousands of claims. Record skips, -actual costs and limitations rather than inferring results from small samples. - -## Implementation decisions after the pilot - -The baseline coordinator's LF-normalized SHA-256 matches the issue exactly: -`2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85`. -The local checkout was retained on its existing history and a new task branch. -Private fixture directories are under ignored pytest storage. - -The ancestry helper retains both directional observations and projection at -every pair. `samefile` uses the same device/inode equality now obtained through -non-following metadata for ordinary directories. Alias test doubles therefore -model matching directory IDs, rather than overriding only the removed stat API. -Added checks cover missing depth, ancestor replacement, Windows short spellings, -and the progress worker surviving the old lifetime cutoff. - -The isolation audit found older CMake integration fixtures that exercise the -default selector. An autouse fixture gives marked CMake tests a private cache -base (`LOCALAPPDATA` on Windows, `XDG_CACHE_HOME` elsewhere), retaining a shared -namespace across build trees within each test. Explicit lock-root tests retain -their explicit selection. No existing shared registry was inspected or changed. - -The 64-claim/11-plan pilot measured 9.02 s setup and 12.34 s registry validation. -The larger measured run is capped at 1,024 claims/11 plans, roughly six minutes -projected including setup; 2,048+ cases are supported but not measured here. -The benchmark now separately measures lock acquisition, actual registry-lock -occupancy, and current-plan validation, and enforces a new directory per sample. - -The later [optimization review](registry-validation-refinements.md) evaluates -further metadata and locking changes. Its final refinement removes a repeated -existence search used only to construct the projection's ancestor list, while -retaining every component check, leaf type check, strict resolution and retry. diff --git a/docs/registry-validation-feasibility.json b/docs/registry-validation-feasibility.json deleted file mode 100644 index 6cef532..0000000 --- a/docs/registry-validation-feasibility.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "platform": "Windows", - "python": "3.12.9", - "coordinator_sha256": "1b0fb79eae89041c2b4949c713ec66d8d18e28941780a6652ddd6fb619b2bf87", - "timings_include_instrumentation": true, - "measurement": "Disjoint outermost function timers; every check delegates unchanged", - "sample": { - "retained_claims": 64, - "current_plans": 11, - "seed_wall_seconds": 4.133827799989376, - "seed_cpu_seconds": 2.9375, - "validation_wall_seconds": 7.560460099950433, - "validation_cpu_seconds": 7.484375, - "reconcile_wall_seconds": 8.651100200018845, - "reconcile_cpu_seconds": 8.390625, - "lock_wait_wall_seconds": 0.14277940010651946, - "registry_lock_held_wall_seconds": 8.637750900001265, - "current_plan_validation_wall_seconds": 0.3990691000362858, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 64, - "path_projections_in_validation": 7621, - "path_projections_total": 8655, - "validation_filesystem_calls": { - "nt.stat": 160990, - "nt.lstat": 14664, - "nt._getfinalpathname": 15242 - }, - "completed_plans": 11 - }, - "disjoint_direct_registry_phases": { - "project_path": { - "calls": 45, - "wall_seconds": 0.025041300046723336 - }, - "_paths_overlap": { - "calls": 2860, - "wall_seconds": 6.196185298904311 - }, - "_load_json": { - "calls": 64, - "wall_seconds": 0.06436010013567284 - }, - "claim_path_authentication": { - "calls": 64, - "wall_seconds": 0.15887819975614548 - }, - "recorded_plan_authentication": { - "calls": 64, - "wall_seconds": 0.6475167000317015 - }, - "_path_key": { - "calls": 704, - "wall_seconds": 0.43822220008587465 - } - } -} diff --git a/docs/registry-validation-refinements.md b/docs/registry-validation-refinements.md deleted file mode 100644 index 0d44aac..0000000 --- a/docs/registry-validation-refinements.md +++ /dev/null @@ -1,198 +0,0 @@ -# Further registry optimization review - -This follow-up compares against the first issue #54 implementation, rather than -claiming its improvements again. All measurements use new private registries; -the previous coordinator is preserved only in ignored local comparison storage. - -Final choice: keep only lexical ancestor-list construction, eliminating one -duplicate existence query per stable projection. The Windows attribute-query -experiment was tested and discarded: its incremental benefit was inconsistent -across installed Python 3.12.9 and 3.14.4. Lock ordering/lifetime is unchanged. - -## Findings and proposed changes (before implementation) - -An 8-claim/11-plan profile measured 2.005 s registry validation. `project_path` -accounted for 1.230 s cumulatively; `_is_link` accounted for 0.616 s through -9,775 rich `lstat` probes. Physical ancestry checks accounted for another -0.744 s. These cumulative costs overlap and must not be added together. -The process performed 19,537 `lstat`, 1,069 `stat`, 3,077 native existence -queries and 2,138 final-path resolutions during registry validation. - -Two bounded improvements are worth testing: - -1. On Windows, `_is_link` only needs to know whether an ordinary path could be - a link/reparse point. Query `GetFileAttributesW` freshly at every existing - check. If the query succeeds and the reparse bit is absent, return false. - For every reparse point or failed query, use the existing `lstat` and tag/ - mode handling unchanged. Do not replace physical identity probes, final-path - resolution, directory-type checks, or post-projection revalidation. -2. `_existing_chain` repeats existence searches only to construct an ancestor - list. Construct that list lexically instead, retaining a fresh link check for - every component, the separate leaf type check, strict resolution and all - eight retry attempts. If the leaf disappears, these subsequent observations - still retry the complete projection. No existence observation is reused. - -Only the Win32 function binding may be retained, never returned attributes. -Pass the original spelling to the API: adding an extended-path prefix would -change Windows trailing-dot/space normalization. Embedded NUL input must fall -back to the original path API, avoiding C-string truncation. Failed attribute -queries (including share roots or long paths) must also fall back, preserving -the original permission-error and missing-path behavior. Other reparse tags -must retain their original treatment rather than rejecting all reparse points. -Non-Windows `_is_link` behavior remains unchanged. - -The first change substitutes a cheaper query for rich metadata; it does not -remove the corresponding filesystem observation. Count the new native queries -explicitly in both benchmark and POC. The second change removes an actual -existence probe per projection without removing link/type/identity checks. -The complete retained-claim/current-plan cross product remains O(claims * plans) -for bounded target counts and depth; no cross-comparison cache is introduced. - -Windows API contracts used here are documented by Microsoft: -[GetFileAttributesW](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfileattributesw) -and [file attribute constants](https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants). - -## Locking assessment - -The measured 1,024-claim run spent 220.612 s in registry validation but only -0.246 s preparing/acquiring locks. Removing a lock cannot address that dominant -cost. Registry serialization protects claim/plan visibility through commit; -generation locks exclude active generators and staging retirement; publication -locks exclude recovery/output mutations. Keep all three and the current order. - -There is a separate potential contention problem: reconciliation holds registry -while waiting for a busy root's generation lock, blocking unrelated claim writers. -The uncontended POC does not measure that scenario. Addressing it requires a -coordinated protocol change, not deleting an acquisition: - -- Taking generation locks before registry for every reconciliation/reset writer - could avoid this convoy, but mixing old/new ordering deadlocks. Old processes - from other checkouts can still share the registry, so a unilateral reorder is - unsafe without a compatible migration protocol. -- A nonblocking generation-lock attempt while holding registry, followed by - releasing all locks before waiting/retrying, preserves acquisition order but - needs starvation bounds, fresh key/path validation and concurrency coverage. - It could reduce unrelated-writer latency; it will not speed up the single - operation's filesystem validation. Leave this as a targeted future experiment. -- Shared registry reads or validation outside the exclusive lock need a registry - generation/retry protocol and revalidation before publication. Registry version - checks alone do not detect external filesystem replacements. No such shortcut - is justified by the present measurements. - -## Bounded acceptance plan - -Test the attribute fast path, both fallback cases, access failures, arbitrary -reparse tags, original Windows path spellings, embedded NUL, and real junctions. -Retain and strengthen disappearing-leaf, replacement-between-observations, -alias, crash/recovery and concurrent-writer regressions. Count native attribute -and existence queries so replacing `lstat` cannot masquerade as eliminating all -filesystem work. Run an alternating small benchmark matrix against the first -issue #54 implementation, plus focused/full unit tests and focused CMake tests. -Only repeat the 1,024-claim run if the pilot demonstrates a meaningful gain; -keep that run bounded at one sample and approximately six minutes including setup. - -## Results and final implementation - -All timings are instrumented Windows workstation observations, with uncontrolled -cache/machine activity. Operation counts are more reliable than small timing -differences. Samples are retained in the `refinements` section of -[the sanitized result JSON](registry-validation-results.json). - -The initial combined prototype (attribute queries plus lexical ancestor list) -showed 4.150 s → 3.791 s median registry validation and 6.639 s → 5.745 s total -reconciliation over three alternating 16-claim/11-plan pairs. A full small POC -matrix completed for both sources. Further tests compared the attribute fast -path specifically against the simpler lexical-list variant: - -| Runtime | Simple variant total median | Attribute variant total median | Attribute variant change | -| --- | ---: | ---: | ---: | -| CPython 3.14.4 | 5.886 s | 6.004 s | 2.0% slower | -| CPython 3.12.9 | 5.991 s | 5.672 s | 5.3% faster | - -Each comparison used three alternating pairs. The Python 3.14 validation CPU -median also rose from 3.500 s to 3.781 s with the attribute variant. These mixed -results do not justify extra platform code and fallback semantics. The prototype -passed its focused fallback/path-spelling safety tests, but performance still -failed to establish a reliable advantage. No attribute fast path remains in the -coordinator. Its optional instrumentation remains available when comparing -experimental sources so old measurements do not conceal their replacement queries. - -The final retained change was then compared directly against the previous issue -#54 implementation, with three alternating 16-claim/11-plan pairs on Python -3.14.4: - -| Measurement | Previous fix | Final refinement | -| --- | ---: | ---: | -| Native existence queries during registry validation | 5,821 | 3,816 | -| `stat` / `lstat` calls | 45,814 | 45,814 | -| Final-path resolutions | 4,010 | 4,010 | -| Path projections | 2,005 | 2,005 | -| Registry scans / recorded-plan loads | 1 / 16 | 1 / 16 | -| Median registry validation | 3.398 s | 3.405 s | -| Median total reconciliation | 5.395 s | 5.398 s | -| Median registry-lock occupancy | 5.368 s | 5.363 s | - -This removes exactly 2,005 existence queries (34.4% of that query family; 3.6% -of the metadata operations counted in this table). It preserves every link, -directory type and physical identity observation. Overall timing is within -noise, so no additional wall-time speedup is established. Retain the small -portable simplification and its concrete query reduction, rather than claiming -the prototype's early apparent speedup for the final code. - -The final POC matrix also ran on the installed CPython **3.12.9**, matching the -original issue's runtime. All twelve before/after reconciliations completed. -That Python reports existence queries as `nt.lstat`, while newer Python reports -the corresponding calls as `nt._path_lexists`: - -| Claims / plans | Baseline existence queries | Final existence queries | Eliminated queries / projections | -| --- | ---: | ---: | ---: | -| 0 / 1 | 32 | 20 | 12 | -| 0 / 11 | 342 | 210 | 132 | -| 8 / 1 | 617 | 388 | 229 | -| 8 / 11 | 3,077 | 2,008 | 1,069 | -| 16 / 1 | 1,201 | 756 | 445 | -| 16 / 11 | 5,821 | 3,816 | 2,005 | - -The other counted `nt.stat` and final-path calls stayed identical in every pair. -For 16/11, validation was 3.276 s → 3.416 s in the single POC samples, with -identical 2.969 s CPU: again, no extra wall-time speedup is established. The -timing decision is supported by both runtimes rather than selecting a favorable -early sample. - -The combined prototype's 64-claim pilot took 8.998 s setup and 15.911 s registry -validation. Given the mixed incremental benefit, the bounded-cost decision was -to stop large benchmark work after this pilot. The earlier 1,024-claim run -belongs to the first implementation; no final-refinement 1,024+ speedup is claimed. -The remaining claims × plans work still needs an architecture change for a -large reduction. An index must account for mutable physical topology, and a -lock-wait improvement must address contention while remaining compatible with -older coordinator processes. - -The production change is restricted to deleting `_existing_chain` and building -the same lexical ancestor list inside `project_path`. The new regression covers -the initial leaf becoming absent, a regular file or a directory link before -ancestor checks. Fresh checks and the strict-resolution retry remain. No claim -records, lock protocol, durability fences or publication checks were changed. - -## Final verification - -- Python 3.14.4 full non-CMake suite: **1,724 passed, 41 skipped** (88.31 s). -- Python 3.12.9 coordinator suite: **87 passed, 6 skipped** (61.56 s). - The existing repository pytest package was reused through this process's - import path with plugin autoload disabled; no packages were installed. -- Python 3.14.4 focused CMake integration suite: **16 passed, 1 skipped** - (69.70 s), including lock-wait diagnostics, recovery, competing writers and - the test-registry isolation check. -- Both final Python 3.12.9 POC matrices completed, including continuous progress - and completion diagnostics with no cutoff. -- `ruff check src tests cmake/ProtocyteOutputCoordinator.py`: passed. -- `git diff --check`: passed. -- Final source hashes match the measured final benchmark and POC candidates; - the follow-up baseline hash matches the first implementation's large run. - -Cross-platform runtime verification remains outstanding. No C++ files were -changed, and all fixture registries/data remain private and explicitly isolated. - -For the subsequent under-30-second target, see the [synthetic-equivalence and -architecture assessment](registry-validation-30s-plan.md), including a bounded -phase profiler and explicit performance/safety milestones. diff --git a/docs/registry-validation-results.json b/docs/registry-validation-results.json deleted file mode 100644 index 419d84c..0000000 --- a/docs/registry-validation-results.json +++ /dev/null @@ -1,2731 +0,0 @@ -{ - "description": "Issue 54 isolated synthetic measurements; instrumented descriptive timings", - "baseline_lf_sha256": "2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85", - "poc_baseline": { - "os": "Windows", - "python": "3.14.4", - "coordinator_sha256": "13aa1a7daea37f06f5298c2119be440b9c48347112494e066986d4387c7e3858", - "timings_include_instrumentation": true, - "samples": [ - { - "repetition": 0, - "retained_claims": 0, - "current_plans": 1, - "setup_seconds": 0.043002, - "validation_wall_seconds": 0.046477, - "validation_cpu_seconds": 0.015625, - "reconcile_wall_seconds": 0.181212, - "reconcile_cpu_seconds": 0.125, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 12, - "_physical_location_key": 106, - "_same_physical_path": 97, - "_paths_overlap": 4 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 142, - "own_seconds": 0.012202 - }, - "nt.lstat": { - "calls": 239, - "own_seconds": 0.021578 - }, - "nt._getfinalpathname": { - "calls": 24, - "own_seconds": 0.002912 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 0, - "current_plans": 11, - "setup_seconds": 0.237473, - "validation_wall_seconds": 0.379158, - "validation_cpu_seconds": 0.3125, - "reconcile_wall_seconds": 2.864267, - "reconcile_cpu_seconds": 1.875, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 132, - "_physical_location_key": 1166, - "_same_physical_path": 1067, - "_paths_overlap": 44 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 1562, - "own_seconds": 0.104094 - }, - "nt.lstat": { - "calls": 2629, - "own_seconds": 0.173107 - }, - "nt._getfinalpathname": { - "calls": 264, - "own_seconds": 0.027992 - } - }, - "completed_plans": 11 - }, - { - "repetition": 0, - "retained_claims": 8, - "current_plans": 1, - "setup_seconds": 1.251244, - "validation_wall_seconds": 0.32841, - "validation_cpu_seconds": 0.296875, - "reconcile_wall_seconds": 0.449497, - "reconcile_cpu_seconds": 0.375, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 229, - "_physical_location_key": 1066, - "_same_physical_path": 993, - "_paths_overlap": 44, - "_path_key": 56 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 1250, - "own_seconds": 0.04947 - }, - "nt.lstat": { - "calls": 3649, - "own_seconds": 0.155386 - }, - "nt._getfinalpathname": { - "calls": 458, - "own_seconds": 0.032071 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 8, - "current_plans": 11, - "setup_seconds": 1.218132, - "validation_wall_seconds": 2.211775, - "validation_cpu_seconds": 1.90625, - "reconcile_wall_seconds": 4.318072, - "reconcile_cpu_seconds": 3.359375, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 1069, - "_physical_location_key": 9806, - "_same_physical_path": 9003, - "_paths_overlap": 404, - "_path_key": 136 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 10540, - "own_seconds": 0.469462 - }, - "nt.lstat": { - "calls": 22189, - "own_seconds": 1.073724 - }, - "nt._getfinalpathname": { - "calls": 2138, - "own_seconds": 0.162666 - } - }, - "completed_plans": 11 - }, - { - "repetition": 0, - "retained_claims": 16, - "current_plans": 1, - "setup_seconds": 1.910242, - "validation_wall_seconds": 0.632456, - "validation_cpu_seconds": 0.546875, - "reconcile_wall_seconds": 0.74373, - "reconcile_cpu_seconds": 0.578125, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 445, - "_physical_location_key": 2026, - "_same_physical_path": 1889, - "_paths_overlap": 84, - "_path_key": 112 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 2346, - "own_seconds": 0.09239 - }, - "nt.lstat": { - "calls": 7049, - "own_seconds": 0.298174 - }, - "nt._getfinalpathname": { - "calls": 890, - "own_seconds": 0.062642 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "setup_seconds": 1.971172, - "validation_wall_seconds": 4.094103, - "validation_cpu_seconds": 3.453125, - "reconcile_wall_seconds": 6.298106, - "reconcile_cpu_seconds": 4.953125, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 2005, - "_physical_location_key": 18446, - "_same_physical_path": 16939, - "_paths_overlap": 764, - "_path_key": 272 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 19396, - "own_seconds": 0.856869 - }, - "nt.lstat": { - "calls": 41749, - "own_seconds": 1.98936 - }, - "nt._getfinalpathname": { - "calls": 4010, - "own_seconds": 0.295814 - } - }, - "completed_plans": 11 - } - ], - "progress_demo": { - "production_interval_seconds": 5.0, - "production_max_periodic_reports": 12, - "nominal_production_cutoff_seconds": 60.0, - "demo_interval_seconds": 0.01, - "periodic_reports": 12, - "claims_at_last_periodic_report": 19, - "claims_at_completion": 40, - "suppression_message_seen": true, - "completion_message_seen": true - } - }, - "poc_candidate": { - "os": "Windows", - "python": "3.14.4", - "coordinator_sha256": "2a3fad28c68b5976c887022268c11c7ecdaefcc129a4bd2f6a9eb01f77e3eb2d", - "timings_include_instrumentation": true, - "samples": [ - { - "repetition": 0, - "retained_claims": 0, - "current_plans": 1, - "setup_seconds": 0.037532, - "validation_wall_seconds": 0.029386, - "validation_cpu_seconds": 0.015625, - "reconcile_wall_seconds": 0.184244, - "reconcile_cpu_seconds": 0.09375, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 12, - "_physical_location_key": 9, - "_paths_overlap": 4 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 12, - "own_seconds": 0.000709 - }, - "nt.lstat": { - "calls": 234, - "own_seconds": 0.019115 - }, - "nt._getfinalpathname": { - "calls": 24, - "own_seconds": 0.002747 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 0, - "current_plans": 11, - "setup_seconds": 0.202995, - "validation_wall_seconds": 0.256031, - "validation_cpu_seconds": 0.203125, - "reconcile_wall_seconds": 3.152033, - "reconcile_cpu_seconds": 2.0, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 132, - "_physical_location_key": 99, - "_paths_overlap": 44 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 132, - "own_seconds": 0.007874 - }, - "nt.lstat": { - "calls": 2574, - "own_seconds": 0.163693 - }, - "nt._getfinalpathname": { - "calls": 264, - "own_seconds": 0.024221 - } - }, - "completed_plans": 11 - }, - { - "repetition": 0, - "retained_claims": 8, - "current_plans": 1, - "setup_seconds": 1.632386, - "validation_wall_seconds": 0.674728, - "validation_cpu_seconds": 0.4375, - "reconcile_wall_seconds": 0.925574, - "reconcile_cpu_seconds": 0.578125, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 229, - "_physical_location_key": 89, - "_paths_overlap": 44, - "_path_key": 56, - "_same_physical_path": 16 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 229, - "own_seconds": 0.025218 - }, - "nt.lstat": { - "calls": 3565, - "own_seconds": 0.412761 - }, - "nt._getfinalpathname": { - "calls": 458, - "own_seconds": 0.071264 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 8, - "current_plans": 11, - "setup_seconds": 2.312549, - "validation_wall_seconds": 2.09775, - "validation_cpu_seconds": 1.65625, - "reconcile_wall_seconds": 4.446544, - "reconcile_cpu_seconds": 3.03125, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 1069, - "_physical_location_key": 819, - "_paths_overlap": 404, - "_path_key": 136, - "_same_physical_path": 16 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 1069, - "own_seconds": 0.063701 - }, - "nt.lstat": { - "calls": 21425, - "own_seconds": 1.318545 - }, - "nt._getfinalpathname": { - "calls": 2138, - "own_seconds": 0.192584 - } - }, - "completed_plans": 11 - }, - { - "repetition": 0, - "retained_claims": 16, - "current_plans": 1, - "setup_seconds": 1.978547, - "validation_wall_seconds": 0.592637, - "validation_cpu_seconds": 0.515625, - "reconcile_wall_seconds": 0.72362, - "reconcile_cpu_seconds": 0.546875, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 445, - "_physical_location_key": 169, - "_paths_overlap": 84, - "_path_key": 112, - "_same_physical_path": 32 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 445, - "own_seconds": 0.020989 - }, - "nt.lstat": { - "calls": 6885, - "own_seconds": 0.331744 - }, - "nt._getfinalpathname": { - "calls": 890, - "own_seconds": 0.064971 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "setup_seconds": 2.135986, - "validation_wall_seconds": 3.673945, - "validation_cpu_seconds": 2.828125, - "reconcile_wall_seconds": 5.767887, - "reconcile_cpu_seconds": 4.171875, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 2005, - "_physical_location_key": 1539, - "_paths_overlap": 764, - "_path_key": 272, - "_same_physical_path": 32 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 2005, - "own_seconds": 0.110363 - }, - "nt.lstat": { - "calls": 40265, - "own_seconds": 2.280778 - }, - "nt._getfinalpathname": { - "calls": 4010, - "own_seconds": 0.34219 - } - }, - "completed_plans": 11 - } - ], - "progress_demo": { - "production_interval_seconds": 5.0, - "production_max_periodic_reports": 12, - "nominal_production_cutoff_seconds": 60.0, - "demo_interval_seconds": 0.01, - "periodic_reports": 26, - "claims_at_last_periodic_report": 39, - "claims_at_completion": 40, - "suppression_message_seen": false, - "completion_message_seen": true - } - }, - "alternating": { - "platform": "Windows", - "python": "3.14.4", - "timings_include_instrumentation": true, - "setup_method": "private locked initialization/reconciliation (issue #54 POC)", - "coordinator_sha256": { - "baseline": "13aa1a7daea37f06f5298c2119be440b9c48347112494e066986d4387c7e3858", - "candidate": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5" - }, - "samples": [ - { - "revision": "baseline", - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.258123899984639, - "seed_cpu_seconds": 1.28125, - "validation_wall_seconds": 6.3589739999733865, - "validation_cpu_seconds": 5.4375, - "reconcile_wall_seconds": 9.633987099980004, - "reconcile_cpu_seconds": 7.421875, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 20979, - "nt.lstat": 45293, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 3.7509025000035763, - "seed_cpu_seconds": 1.734375, - "validation_wall_seconds": 4.355008200043812, - "validation_cpu_seconds": 3.796875, - "reconcile_wall_seconds": 7.462864799948875, - "reconcile_cpu_seconds": 5.6875, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 1, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.709061599976849, - "seed_cpu_seconds": 1.625, - "validation_wall_seconds": 4.752622700005304, - "validation_cpu_seconds": 3.875, - "reconcile_wall_seconds": 7.622923300019465, - "reconcile_cpu_seconds": 5.640625, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - }, - { - "revision": "baseline", - "repetition": 1, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 3.1427328000427224, - "seed_cpu_seconds": 1.609375, - "validation_wall_seconds": 6.718977300042752, - "validation_cpu_seconds": 5.265625, - "reconcile_wall_seconds": 12.058677699998952, - "reconcile_cpu_seconds": 7.75, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 20979, - "nt.lstat": 45293, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - }, - { - "revision": "baseline", - "repetition": 2, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 3.1493273000232875, - "seed_cpu_seconds": 1.75, - "validation_wall_seconds": 7.2300827000290155, - "validation_cpu_seconds": 5.8125, - "reconcile_wall_seconds": 10.46813039999688, - "reconcile_cpu_seconds": 7.875, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 20979, - "nt.lstat": 45293, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 2, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.7407475999789312, - "seed_cpu_seconds": 1.578125, - "validation_wall_seconds": 4.551891399954911, - "validation_cpu_seconds": 4.078125, - "reconcile_wall_seconds": 7.671269699989352, - "reconcile_cpu_seconds": 6.046875, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - } - ], - "medians": [ - { - "retained_claims": 16, - "current_plans": 11, - "baseline": { - "seed_wall_seconds": 3.1427328000427224, - "seed_cpu_seconds": 1.609375, - "validation_wall_seconds": 6.718977300042752, - "validation_cpu_seconds": 5.4375, - "reconcile_wall_seconds": 10.46813039999688, - "reconcile_cpu_seconds": 7.75, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039 - }, - "candidate": { - "seed_wall_seconds": 2.7407475999789312, - "seed_cpu_seconds": 1.625, - "validation_wall_seconds": 4.551891399954911, - "validation_cpu_seconds": 3.875, - "reconcile_wall_seconds": 7.622923300019465, - "reconcile_cpu_seconds": 5.6875, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039 - }, - "wall_time_reduction_percent": 27.179706320607767 - } - ] - }, - "lock_occupancy": { - "platform": "Windows", - "python": "3.14.4", - "timings_include_instrumentation": true, - "setup_method": "private locked initialization/reconciliation (issue #54 POC)", - "coordinator_sha256": { - "baseline": "13aa1a7daea37f06f5298c2119be440b9c48347112494e066986d4387c7e3858", - "candidate": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5" - }, - "samples": [ - { - "revision": "baseline", - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.1276385000091977, - "seed_cpu_seconds": 1.359375, - "validation_wall_seconds": 4.7870832000044174, - "validation_cpu_seconds": 4.453125, - "reconcile_wall_seconds": 7.1144024999812245, - "reconcile_cpu_seconds": 6.21875, - "lock_wait_wall_seconds": 0.23898560006637126, - "registry_lock_held_wall_seconds": 7.090437799983192, - "current_plan_validation_wall_seconds": 1.0748708000173792, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 20979, - "nt.lstat": 45293, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.170645500009414, - "seed_cpu_seconds": 1.28125, - "validation_wall_seconds": 3.574637999990955, - "validation_cpu_seconds": 3.3125, - "reconcile_wall_seconds": 5.622308599995449, - "reconcile_cpu_seconds": 4.71875, - "lock_wait_wall_seconds": 0.2729834000347182, - "registry_lock_held_wall_seconds": 5.586250799999107, - "current_plan_validation_wall_seconds": 0.7457271000021137, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - } - ], - "medians": [ - { - "retained_claims": 16, - "current_plans": 11, - "baseline": { - "seed_wall_seconds": 2.1276385000091977, - "seed_cpu_seconds": 1.359375, - "validation_wall_seconds": 4.7870832000044174, - "validation_cpu_seconds": 4.453125, - "reconcile_wall_seconds": 7.1144024999812245, - "reconcile_cpu_seconds": 6.21875, - "lock_wait_wall_seconds": 0.23898560006637126, - "registry_lock_held_wall_seconds": 7.090437799983192, - "current_plan_validation_wall_seconds": 1.0748708000173792, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039 - }, - "candidate": { - "seed_wall_seconds": 2.170645500009414, - "seed_cpu_seconds": 1.28125, - "validation_wall_seconds": 3.574637999990955, - "validation_cpu_seconds": 3.3125, - "reconcile_wall_seconds": 5.622308599995449, - "reconcile_cpu_seconds": 4.71875, - "lock_wait_wall_seconds": 0.2729834000347182, - "registry_lock_held_wall_seconds": 5.586250799999107, - "current_plan_validation_wall_seconds": 0.7457271000021137, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039 - }, - "wall_time_reduction_percent": 20.972863146128052 - } - ] - }, - "medium": { - "platform": "Windows", - "python": "3.14.4", - "timings_include_instrumentation": true, - "setup_method": "private locked initialization/reconciliation (issue #54 POC)", - "coordinator_sha256": { - "candidate": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5" - }, - "samples": [ - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 64, - "current_plans": 11, - "seed_wall_seconds": 9.023429700057022, - "seed_cpu_seconds": 4.59375, - "validation_wall_seconds": 12.341692899994086, - "validation_cpu_seconds": 11.109375, - "reconcile_wall_seconds": 14.397634299995843, - "reconcile_cpu_seconds": 12.4375, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 64, - "path_projections_in_validation": 7621, - "path_projections_total": 8655, - "validation_filesystem_calls": { - "nt.stat": 7621, - "nt.lstat": 166785, - "nt._getfinalpathname": 15242 - }, - "completed_plans": 11 - } - ], - "medians": [ - { - "retained_claims": 64, - "current_plans": 11, - "candidate": { - "seed_wall_seconds": 9.023429700057022, - "seed_cpu_seconds": 4.59375, - "validation_wall_seconds": 12.341692899994086, - "validation_cpu_seconds": 11.109375, - "reconcile_wall_seconds": 14.397634299995843, - "reconcile_cpu_seconds": 12.4375, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 64, - "path_projections_in_validation": 7621, - "path_projections_total": 8655 - } - } - ] - }, - "large": { - "platform": "Windows", - "python": "3.14.4", - "timings_include_instrumentation": true, - "setup_method": "private locked initialization/reconciliation (issue #54 POC)", - "coordinator_sha256": { - "candidate": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5" - }, - "samples": [ - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 1024, - "current_plans": 11, - "seed_wall_seconds": 136.6321732000215, - "seed_cpu_seconds": 79.828125, - "validation_wall_seconds": 220.61243189999368, - "validation_cpu_seconds": 198.671875, - "reconcile_wall_seconds": 222.48733269999502, - "reconcile_cpu_seconds": 199.921875, - "lock_wait_wall_seconds": 0.24559350009076297, - "registry_lock_held_wall_seconds": 222.46272490004776, - "current_plan_validation_wall_seconds": 0.6697284000110812, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 1024, - "path_projections_in_validation": 119941, - "path_projections_total": 120975, - "validation_filesystem_calls": { - "nt.stat": 119941, - "nt.lstat": 2626305, - "nt._getfinalpathname": 239882 - }, - "completed_plans": 11 - } - ], - "medians": [ - { - "retained_claims": 1024, - "current_plans": 11, - "candidate": { - "seed_wall_seconds": 136.6321732000215, - "seed_cpu_seconds": 79.828125, - "validation_wall_seconds": 220.61243189999368, - "validation_cpu_seconds": 198.671875, - "reconcile_wall_seconds": 222.48733269999502, - "reconcile_cpu_seconds": 199.921875, - "lock_wait_wall_seconds": 0.24559350009076297, - "registry_lock_held_wall_seconds": 222.46272490004776, - "current_plan_validation_wall_seconds": 0.6697284000110812, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 1024, - "path_projections_in_validation": 119941, - "path_projections_total": 120975 - } - } - ] - }, - "poc_candidate_metadata_note": "Initial original-POC candidate run retained MAX_REPORTS as ignored legacy metadata; reporting was already uncapped (26 reports). Final code removes the constant. Reconciliation algorithm is unchanged; final POC smoke confirms current progress metadata.", - "final_poc_smoke": { - "os": "Windows", - "python": "3.14.4", - "coordinator_sha256": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5", - "timings_include_instrumentation": true, - "samples": [ - { - "repetition": 0, - "retained_claims": 0, - "current_plans": 1, - "setup_seconds": 0.040341, - "validation_wall_seconds": 0.021879, - "validation_cpu_seconds": 0.03125, - "reconcile_wall_seconds": 0.150081, - "reconcile_cpu_seconds": 0.0625, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 12, - "_physical_location_key": 9, - "_paths_overlap": 4 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 12, - "own_seconds": 0.000739 - }, - "nt.lstat": { - "calls": 234, - "own_seconds": 0.012535 - }, - "nt._getfinalpathname": { - "calls": 24, - "own_seconds": 0.002479 - } - }, - "completed_plans": 1 - } - ], - "progress_demo": { - "production_interval_seconds": 5.0, - "production_max_periodic_reports": null, - "nominal_production_cutoff_seconds": null, - "demo_interval_seconds": 0.01, - "periodic_reports": 26, - "claims_at_last_periodic_report": 39, - "claims_at_completion": 40, - "suppression_message_seen": false, - "completion_message_seen": true - } - }, - "refinements": { - "scope": "Compare follow-up refinements against the first issue-54 implementation; all registries isolated", - "final_choice": "Lexical ancestor list only; Windows attribute prototype was discarded", - "combined_prototype_comparison_py314": { - "platform": "Windows", - "python": "3.14.4", - "timings_include_instrumentation": true, - "setup_method": "private locked initialization/reconciliation (issue #54 POC)", - "coordinator_sha256": { - "baseline": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5", - "candidate": "87baa64350e2f36223570ce69ee93927a54146a9bcf62031b5ae4e87ab629ac6" - }, - "samples": [ - { - "revision": "baseline", - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 1.9613413999904878, - "seed_cpu_seconds": 1.078125, - "validation_wall_seconds": 5.155859499995131, - "validation_cpu_seconds": 3.96875, - "reconcile_wall_seconds": 7.1793177999788895, - "reconcile_cpu_seconds": 5.328125, - "lock_wait_wall_seconds": 0.23080189985921606, - "registry_lock_held_wall_seconds": 7.155724500014912, - "current_plan_validation_wall_seconds": 0.8358743999851868, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 5821 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.1849711000104435, - "seed_cpu_seconds": 1.359375, - "validation_wall_seconds": 5.154734499985352, - "validation_cpu_seconds": 4.234375, - "reconcile_wall_seconds": 7.726576299988665, - "reconcile_cpu_seconds": 5.9375, - "lock_wait_wall_seconds": 0.267664700106252, - "registry_lock_held_wall_seconds": 7.698233300005086, - "current_plan_validation_wall_seconds": 1.262812600005418, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "windows_attribute_probes": 22329, - "nt.stat": 2005, - "nt.lstat": 21480, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 3816 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 1, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.2232981999986805, - "seed_cpu_seconds": 1.25, - "validation_wall_seconds": 3.790756299975328, - "validation_cpu_seconds": 3.40625, - "reconcile_wall_seconds": 5.744733300001826, - "reconcile_cpu_seconds": 4.828125, - "lock_wait_wall_seconds": 0.24223959998926148, - "registry_lock_held_wall_seconds": 5.717330500017852, - "current_plan_validation_wall_seconds": 0.629817400011234, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "windows_attribute_probes": 22329, - "nt.stat": 2005, - "nt.lstat": 21480, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 3816 - }, - "completed_plans": 11 - }, - { - "revision": "baseline", - "repetition": 1, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.298384699970484, - "seed_cpu_seconds": 1.421875, - "validation_wall_seconds": 4.149868200009223, - "validation_cpu_seconds": 3.65625, - "reconcile_wall_seconds": 6.639396500017028, - "reconcile_cpu_seconds": 5.34375, - "lock_wait_wall_seconds": 0.2882600998855196, - "registry_lock_held_wall_seconds": 6.605098700034432, - "current_plan_validation_wall_seconds": 1.0071299000410363, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 5821 - }, - "completed_plans": 11 - }, - { - "revision": "baseline", - "repetition": 2, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.0844520999817178, - "seed_cpu_seconds": 1.171875, - "validation_wall_seconds": 3.584759099991061, - "validation_cpu_seconds": 3.296875, - "reconcile_wall_seconds": 5.59393169998657, - "reconcile_cpu_seconds": 4.671875, - "lock_wait_wall_seconds": 0.2621494000777602, - "registry_lock_held_wall_seconds": 5.56750959996134, - "current_plan_validation_wall_seconds": 0.7731327000074089, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 5821 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 2, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 1.9889954999671318, - "seed_cpu_seconds": 1.265625, - "validation_wall_seconds": 3.446725099987816, - "validation_cpu_seconds": 3.15625, - "reconcile_wall_seconds": 5.314111400046386, - "reconcile_cpu_seconds": 4.359375, - "lock_wait_wall_seconds": 0.25852360000135377, - "registry_lock_held_wall_seconds": 5.289039099996444, - "current_plan_validation_wall_seconds": 0.6422870999667794, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "windows_attribute_probes": 22329, - "nt.stat": 2005, - "nt.lstat": 21480, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 3816 - }, - "completed_plans": 11 - } - ], - "medians": [ - { - "retained_claims": 16, - "current_plans": 11, - "baseline": { - "seed_wall_seconds": 2.0844520999817178, - "seed_cpu_seconds": 1.171875, - "validation_wall_seconds": 4.149868200009223, - "validation_cpu_seconds": 3.65625, - "reconcile_wall_seconds": 6.639396500017028, - "reconcile_cpu_seconds": 5.328125, - "lock_wait_wall_seconds": 0.2621494000777602, - "registry_lock_held_wall_seconds": 6.605098700034432, - "current_plan_validation_wall_seconds": 0.8358743999851868, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039 - }, - "candidate": { - "seed_wall_seconds": 2.1849711000104435, - "seed_cpu_seconds": 1.265625, - "validation_wall_seconds": 3.790756299975328, - "validation_cpu_seconds": 3.40625, - "reconcile_wall_seconds": 5.744733300001826, - "reconcile_cpu_seconds": 4.828125, - "lock_wait_wall_seconds": 0.25852360000135377, - "registry_lock_held_wall_seconds": 5.717330500017852, - "current_plan_validation_wall_seconds": 0.6422870999667794, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039 - }, - "wall_time_reduction_percent": 13.475068103146237 - } - ] - }, - "combined_prototype_poc_before": { - "os": "Windows", - "python": "3.14.4", - "coordinator_sha256": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5", - "timings_include_instrumentation": true, - "samples": [ - { - "repetition": 0, - "retained_claims": 0, - "current_plans": 1, - "setup_seconds": 0.02917, - "validation_wall_seconds": 0.015855, - "validation_cpu_seconds": 0.015625, - "reconcile_wall_seconds": 0.14119, - "reconcile_cpu_seconds": 0.046875, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 12, - "_physical_location_key": 9, - "_paths_overlap": 4 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 12, - "own_seconds": 0.000412 - }, - "nt.lstat": { - "calls": 234, - "own_seconds": 0.009512 - }, - "nt._getfinalpathname": { - "calls": 24, - "own_seconds": 0.001531 - }, - "nt._path_lexists": { - "calls": 32, - "own_seconds": 0.00124 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 0, - "current_plans": 11, - "setup_seconds": 0.115803, - "validation_wall_seconds": 0.179843, - "validation_cpu_seconds": 0.171875, - "reconcile_wall_seconds": 2.006723, - "reconcile_cpu_seconds": 1.34375, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 132, - "_physical_location_key": 99, - "_paths_overlap": 44 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 132, - "own_seconds": 0.005514 - }, - "nt.lstat": { - "calls": 2574, - "own_seconds": 0.109306 - }, - "nt._getfinalpathname": { - "calls": 264, - "own_seconds": 0.018805 - }, - "nt._path_lexists": { - "calls": 342, - "own_seconds": 0.014903 - } - }, - "completed_plans": 11 - }, - { - "repetition": 0, - "retained_claims": 8, - "current_plans": 1, - "setup_seconds": 0.921561, - "validation_wall_seconds": 0.36597, - "validation_cpu_seconds": 0.3125, - "reconcile_wall_seconds": 0.494143, - "reconcile_cpu_seconds": 0.375, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 229, - "_physical_location_key": 89, - "_paths_overlap": 44, - "_path_key": 56, - "_same_physical_path": 16 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 229, - "own_seconds": 0.013301 - }, - "nt.lstat": { - "calls": 3565, - "own_seconds": 0.202078 - }, - "nt._getfinalpathname": { - "calls": 458, - "own_seconds": 0.0404 - }, - "nt._path_lexists": { - "calls": 617, - "own_seconds": 0.038689 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 8, - "current_plans": 11, - "setup_seconds": 1.278244, - "validation_wall_seconds": 2.982448, - "validation_cpu_seconds": 2.3125, - "reconcile_wall_seconds": 5.255259, - "reconcile_cpu_seconds": 3.890625, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 1069, - "_physical_location_key": 819, - "_paths_overlap": 404, - "_path_key": 136, - "_same_physical_path": 16 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 1069, - "own_seconds": 0.089835 - }, - "nt.lstat": { - "calls": 21425, - "own_seconds": 1.916833 - }, - "nt._getfinalpathname": { - "calls": 2138, - "own_seconds": 0.263897 - }, - "nt._path_lexists": { - "calls": 3077, - "own_seconds": 0.277359 - } - }, - "completed_plans": 11 - }, - { - "repetition": 0, - "retained_claims": 16, - "current_plans": 1, - "setup_seconds": 2.672677, - "validation_wall_seconds": 1.238014, - "validation_cpu_seconds": 1.015625, - "reconcile_wall_seconds": 1.411422, - "reconcile_cpu_seconds": 1.125, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 445, - "_physical_location_key": 169, - "_paths_overlap": 84, - "_path_key": 112, - "_same_physical_path": 32 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 445, - "own_seconds": 0.044984 - }, - "nt.lstat": { - "calls": 6885, - "own_seconds": 0.73424 - }, - "nt._getfinalpathname": { - "calls": 890, - "own_seconds": 0.131944 - }, - "nt._path_lexists": { - "calls": 1201, - "own_seconds": 0.133026 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "setup_seconds": 2.490903, - "validation_wall_seconds": 5.224276, - "validation_cpu_seconds": 4.5625, - "reconcile_wall_seconds": 7.775355, - "reconcile_cpu_seconds": 6.1875, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 2005, - "_physical_location_key": 1539, - "_paths_overlap": 764, - "_path_key": 272, - "_same_physical_path": 32 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 2005, - "own_seconds": 0.157241 - }, - "nt.lstat": { - "calls": 40265, - "own_seconds": 3.234528 - }, - "nt._getfinalpathname": { - "calls": 4010, - "own_seconds": 0.480778 - }, - "nt._path_lexists": { - "calls": 5821, - "own_seconds": 0.480792 - } - }, - "completed_plans": 11 - } - ], - "progress_demo": { - "production_interval_seconds": 5.0, - "production_max_periodic_reports": null, - "nominal_production_cutoff_seconds": null, - "demo_interval_seconds": 0.01, - "periodic_reports": 27, - "claims_at_last_periodic_report": 40, - "claims_at_completion": 40, - "suppression_message_seen": false, - "completion_message_seen": true - } - }, - "combined_prototype_poc_after": { - "os": "Windows", - "python": "3.14.4", - "coordinator_sha256": "87baa64350e2f36223570ce69ee93927a54146a9bcf62031b5ae4e87ab629ac6", - "timings_include_instrumentation": true, - "samples": [ - { - "repetition": 0, - "retained_claims": 0, - "current_plans": 1, - "setup_seconds": 0.037175, - "validation_wall_seconds": 0.014788, - "validation_cpu_seconds": 0.0, - "reconcile_wall_seconds": 0.128856, - "reconcile_cpu_seconds": 0.0625, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 12, - "_windows_file_attributes": 122, - "_physical_location_key": 9, - "_paths_overlap": 4 - }, - "validation_filesystem_calls": { - "windows_attribute_probes": { - "calls": 122, - "own_seconds": 0.004562 - }, - "nt.stat": { - "calls": 12, - "own_seconds": 0.000572 - }, - "nt.lstat": { - "calls": 112, - "own_seconds": 0.004298 - }, - "nt._getfinalpathname": { - "calls": 24, - "own_seconds": 0.001476 - }, - "nt._path_lexists": { - "calls": 20, - "own_seconds": 0.00091 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 0, - "current_plans": 11, - "setup_seconds": 0.122625, - "validation_wall_seconds": 0.165921, - "validation_cpu_seconds": 0.171875, - "reconcile_wall_seconds": 1.829737, - "reconcile_cpu_seconds": 1.421875, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 132, - "_windows_file_attributes": 1342, - "_physical_location_key": 99, - "_paths_overlap": 44 - }, - "validation_filesystem_calls": { - "windows_attribute_probes": { - "calls": 1342, - "own_seconds": 0.052877 - }, - "nt.stat": { - "calls": 132, - "own_seconds": 0.005423 - }, - "nt.lstat": { - "calls": 1232, - "own_seconds": 0.05196 - }, - "nt._getfinalpathname": { - "calls": 264, - "own_seconds": 0.016646 - }, - "nt._path_lexists": { - "calls": 210, - "own_seconds": 0.008911 - } - }, - "completed_plans": 11 - }, - { - "repetition": 0, - "retained_claims": 8, - "current_plans": 1, - "setup_seconds": 0.956424, - "validation_wall_seconds": 0.457757, - "validation_cpu_seconds": 0.34375, - "reconcile_wall_seconds": 0.598668, - "reconcile_cpu_seconds": 0.40625, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 229, - "_windows_file_attributes": 2414, - "_physical_location_key": 89, - "_paths_overlap": 44, - "_path_key": 56, - "_same_physical_path": 16 - }, - "validation_filesystem_calls": { - "windows_attribute_probes": { - "calls": 2414, - "own_seconds": 0.180845 - }, - "nt.stat": { - "calls": 229, - "own_seconds": 0.016608 - }, - "nt.lstat": { - "calls": 1151, - "own_seconds": 0.08977 - }, - "nt._getfinalpathname": { - "calls": 458, - "own_seconds": 0.051807 - }, - "nt._path_lexists": { - "calls": 388, - "own_seconds": 0.030609 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 8, - "current_plans": 11, - "setup_seconds": 1.039364, - "validation_wall_seconds": 2.024616, - "validation_cpu_seconds": 1.6875, - "reconcile_wall_seconds": 4.093077, - "reconcile_cpu_seconds": 3.078125, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 1069, - "_windows_file_attributes": 10844, - "_physical_location_key": 819, - "_paths_overlap": 404, - "_path_key": 136, - "_same_physical_path": 16 - }, - "validation_filesystem_calls": { - "windows_attribute_probes": { - "calls": 10844, - "own_seconds": 0.638409 - }, - "nt.stat": { - "calls": 1069, - "own_seconds": 0.062137 - }, - "nt.lstat": { - "calls": 10581, - "own_seconds": 0.627289 - }, - "nt._getfinalpathname": { - "calls": 2138, - "own_seconds": 0.198272 - }, - "nt._path_lexists": { - "calls": 2008, - "own_seconds": 0.126718 - } - }, - "completed_plans": 11 - }, - { - "repetition": 0, - "retained_claims": 16, - "current_plans": 1, - "setup_seconds": 1.802842, - "validation_wall_seconds": 0.634957, - "validation_cpu_seconds": 0.59375, - "reconcile_wall_seconds": 0.760531, - "reconcile_cpu_seconds": 0.65625, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 445, - "_windows_file_attributes": 4694, - "_physical_location_key": 169, - "_paths_overlap": 84, - "_path_key": 112, - "_same_physical_path": 32 - }, - "validation_filesystem_calls": { - "windows_attribute_probes": { - "calls": 4694, - "own_seconds": 0.238307 - }, - "nt.stat": { - "calls": 445, - "own_seconds": 0.024316 - }, - "nt.lstat": { - "calls": 2191, - "own_seconds": 0.121356 - }, - "nt._getfinalpathname": { - "calls": 890, - "own_seconds": 0.07108 - }, - "nt._path_lexists": { - "calls": 756, - "own_seconds": 0.044677 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "setup_seconds": 1.969252, - "validation_wall_seconds": 4.581015, - "validation_cpu_seconds": 3.8125, - "reconcile_wall_seconds": 6.725737, - "reconcile_cpu_seconds": 5.21875, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 2005, - "_windows_file_attributes": 20324, - "_physical_location_key": 1539, - "_paths_overlap": 764, - "_path_key": 272, - "_same_physical_path": 32 - }, - "validation_filesystem_calls": { - "windows_attribute_probes": { - "calls": 20324, - "own_seconds": 1.438408 - }, - "nt.stat": { - "calls": 2005, - "own_seconds": 0.14439 - }, - "nt.lstat": { - "calls": 19941, - "own_seconds": 1.451434 - }, - "nt._getfinalpathname": { - "calls": 4010, - "own_seconds": 0.432472 - }, - "nt._path_lexists": { - "calls": 3816, - "own_seconds": 0.295758 - } - }, - "completed_plans": 11 - } - ], - "progress_demo": { - "production_interval_seconds": 5.0, - "production_max_periodic_reports": null, - "nominal_production_cutoff_seconds": null, - "demo_interval_seconds": 0.01, - "periodic_reports": 26, - "claims_at_last_periodic_report": 39, - "claims_at_completion": 40, - "suppression_message_seen": false, - "completion_message_seen": true - } - }, - "attribute_ablation_py314": { - "platform": "Windows", - "python": "3.14.4", - "timings_include_instrumentation": true, - "setup_method": "private locked initialization/reconciliation (issue #54 POC)", - "coordinator_sha256": { - "baseline": "0dfdefbf5a66a17094cd6abaa0dfe4d55dde9639574d1440d8c25a7110a96d60", - "candidate": "87baa64350e2f36223570ce69ee93927a54146a9bcf62031b5ae4e87ab629ac6" - }, - "samples": [ - { - "revision": "baseline", - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 1.9255942000309005, - "seed_cpu_seconds": 1.0625, - "validation_wall_seconds": 3.8907204999704845, - "validation_cpu_seconds": 3.5, - "reconcile_wall_seconds": 5.886366199993063, - "reconcile_cpu_seconds": 4.90625, - "lock_wait_wall_seconds": 0.3129801002214663, - "registry_lock_held_wall_seconds": 5.845657699974254, - "current_plan_validation_wall_seconds": 0.6578052999684587, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 3816 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 1.9502744999481365, - "seed_cpu_seconds": 1.28125, - "validation_wall_seconds": 5.352577700046822, - "validation_cpu_seconds": 4.328125, - "reconcile_wall_seconds": 7.426365299965255, - "reconcile_cpu_seconds": 5.59375, - "lock_wait_wall_seconds": 0.22541349980747327, - "registry_lock_held_wall_seconds": 7.404415099998005, - "current_plan_validation_wall_seconds": 0.7058043000288308, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "windows_attribute_probes": 22329, - "nt.stat": 2005, - "nt.lstat": 21480, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 3816 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 1, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.471324199985247, - "seed_cpu_seconds": 1.5625, - "validation_wall_seconds": 3.514202899998054, - "validation_cpu_seconds": 3.234375, - "reconcile_wall_seconds": 6.003659999987576, - "reconcile_cpu_seconds": 4.8125, - "lock_wait_wall_seconds": 0.44804170000134036, - "registry_lock_held_wall_seconds": 5.979545499954838, - "current_plan_validation_wall_seconds": 0.9495452999835834, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "windows_attribute_probes": 22329, - "nt.stat": 2005, - "nt.lstat": 21480, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 3816 - }, - "completed_plans": 11 - }, - { - "revision": "baseline", - "repetition": 1, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.360893000033684, - "seed_cpu_seconds": 1.40625, - "validation_wall_seconds": 4.542891199991573, - "validation_cpu_seconds": 4.171875, - "reconcile_wall_seconds": 6.766588699945714, - "reconcile_cpu_seconds": 5.859375, - "lock_wait_wall_seconds": 0.2927765001077205, - "registry_lock_held_wall_seconds": 6.73910419997992, - "current_plan_validation_wall_seconds": 0.8883354000281543, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 3816 - }, - "completed_plans": 11 - }, - { - "revision": "baseline", - "repetition": 2, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.1543265000218526, - "seed_cpu_seconds": 1.234375, - "validation_wall_seconds": 3.403330700006336, - "validation_cpu_seconds": 3.21875, - "reconcile_wall_seconds": 5.410496700031217, - "reconcile_cpu_seconds": 4.71875, - "lock_wait_wall_seconds": 0.27812690002610907, - "registry_lock_held_wall_seconds": 5.383742100035306, - "current_plan_validation_wall_seconds": 0.7689135000109673, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 3816 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 2, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.039945499971509, - "seed_cpu_seconds": 1.296875, - "validation_wall_seconds": 3.9925649000215344, - "validation_cpu_seconds": 3.78125, - "reconcile_wall_seconds": 5.979028500034474, - "reconcile_cpu_seconds": 5.1875, - "lock_wait_wall_seconds": 0.25394970015622675, - "registry_lock_held_wall_seconds": 5.954361899988726, - "current_plan_validation_wall_seconds": 0.7750130000058562, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "windows_attribute_probes": 22329, - "nt.stat": 2005, - "nt.lstat": 21480, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 3816 - }, - "completed_plans": 11 - } - ], - "medians": [ - { - "retained_claims": 16, - "current_plans": 11, - "baseline": { - "seed_wall_seconds": 2.1543265000218526, - "seed_cpu_seconds": 1.234375, - "validation_wall_seconds": 3.8907204999704845, - "validation_cpu_seconds": 3.5, - "reconcile_wall_seconds": 5.886366199993063, - "reconcile_cpu_seconds": 4.90625, - "lock_wait_wall_seconds": 0.2927765001077205, - "registry_lock_held_wall_seconds": 5.845657699974254, - "current_plan_validation_wall_seconds": 0.7689135000109673, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039 - }, - "candidate": { - "seed_wall_seconds": 2.039945499971509, - "seed_cpu_seconds": 1.296875, - "validation_wall_seconds": 3.9925649000215344, - "validation_cpu_seconds": 3.78125, - "reconcile_wall_seconds": 6.003659999987576, - "reconcile_cpu_seconds": 5.1875, - "lock_wait_wall_seconds": 0.25394970015622675, - "registry_lock_held_wall_seconds": 5.979545499954838, - "current_plan_validation_wall_seconds": 0.7750130000058562, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039 - }, - "wall_time_reduction_percent": -1.9926351166302148 - } - ] - }, - "attribute_ablation_py312": { - "platform": "Windows", - "python": "3.12.9", - "timings_include_instrumentation": true, - "setup_method": "private locked initialization/reconciliation (issue #54 POC)", - "coordinator_sha256": { - "baseline": "0dfdefbf5a66a17094cd6abaa0dfe4d55dde9639574d1440d8c25a7110a96d60", - "candidate": "87baa64350e2f36223570ce69ee93927a54146a9bcf62031b5ae4e87ab629ac6" - }, - "samples": [ - { - "revision": "baseline", - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 1.9380826000124216, - "seed_cpu_seconds": 1.046875, - "validation_wall_seconds": 3.8743141999584623, - "validation_cpu_seconds": 3.328125, - "reconcile_wall_seconds": 5.991393300006166, - "reconcile_cpu_seconds": 4.734375, - "lock_wait_wall_seconds": 0.28451779996976256, - "registry_lock_held_wall_seconds": 5.964167799975257, - "current_plan_validation_wall_seconds": 0.8961926000192761, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 45830, - "nt.lstat": 3816, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.012949399999343, - "seed_cpu_seconds": 1.21875, - "validation_wall_seconds": 3.7962633999995887, - "validation_cpu_seconds": 3.421875, - "reconcile_wall_seconds": 5.672135500004515, - "reconcile_cpu_seconds": 4.75, - "lock_wait_wall_seconds": 0.2546841001021676, - "registry_lock_held_wall_seconds": 5.642989900021348, - "current_plan_validation_wall_seconds": 0.6838864999590442, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "windows_attribute_probes": 22329, - "nt.stat": 23501, - "nt.lstat": 3816, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 1, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.039824499981478, - "seed_cpu_seconds": 1.265625, - "validation_wall_seconds": 3.449085699976422, - "validation_cpu_seconds": 3.125, - "reconcile_wall_seconds": 5.33054929994978, - "reconcile_cpu_seconds": 4.421875, - "lock_wait_wall_seconds": 0.24748950003413484, - "registry_lock_held_wall_seconds": 5.306947000033688, - "current_plan_validation_wall_seconds": 0.7296249000355601, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "windows_attribute_probes": 22329, - "nt.stat": 23501, - "nt.lstat": 3816, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - }, - { - "revision": "baseline", - "repetition": 1, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.1450219999533147, - "seed_cpu_seconds": 1.359375, - "validation_wall_seconds": 3.456297299999278, - "validation_cpu_seconds": 3.3125, - "reconcile_wall_seconds": 5.434559200017247, - "reconcile_cpu_seconds": 4.75, - "lock_wait_wall_seconds": 0.25926460011396557, - "registry_lock_held_wall_seconds": 5.409031699993648, - "current_plan_validation_wall_seconds": 0.7916680000489578, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 45830, - "nt.lstat": 3816, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - }, - { - "revision": "baseline", - "repetition": 2, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.1303489999845624, - "seed_cpu_seconds": 1.203125, - "validation_wall_seconds": 4.043143099988811, - "validation_cpu_seconds": 3.71875, - "reconcile_wall_seconds": 6.259159700013697, - "reconcile_cpu_seconds": 5.3125, - "lock_wait_wall_seconds": 0.24932060012361035, - "registry_lock_held_wall_seconds": 6.231611900031567, - "current_plan_validation_wall_seconds": 1.0439072999870405, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 45830, - "nt.lstat": 3816, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 2, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.072428699990269, - "seed_cpu_seconds": 1.390625, - "validation_wall_seconds": 3.7062581999925897, - "validation_cpu_seconds": 3.421875, - "reconcile_wall_seconds": 5.67605279997224, - "reconcile_cpu_seconds": 4.875, - "lock_wait_wall_seconds": 0.26414589991327375, - "registry_lock_held_wall_seconds": 5.65008199994918, - "current_plan_validation_wall_seconds": 0.7793610999942757, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "windows_attribute_probes": 22329, - "nt.stat": 23501, - "nt.lstat": 3816, - "nt._getfinalpathname": 4010 - }, - "completed_plans": 11 - } - ], - "medians": [ - { - "retained_claims": 16, - "current_plans": 11, - "baseline": { - "seed_wall_seconds": 2.1303489999845624, - "seed_cpu_seconds": 1.203125, - "validation_wall_seconds": 3.8743141999584623, - "validation_cpu_seconds": 3.328125, - "reconcile_wall_seconds": 5.991393300006166, - "reconcile_cpu_seconds": 4.75, - "lock_wait_wall_seconds": 0.25926460011396557, - "registry_lock_held_wall_seconds": 5.964167799975257, - "current_plan_validation_wall_seconds": 0.8961926000192761, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039 - }, - "candidate": { - "seed_wall_seconds": 2.039824499981478, - "seed_cpu_seconds": 1.265625, - "validation_wall_seconds": 3.7062581999925897, - "validation_cpu_seconds": 3.421875, - "reconcile_wall_seconds": 5.672135500004515, - "reconcile_cpu_seconds": 4.75, - "lock_wait_wall_seconds": 0.2546841001021676, - "registry_lock_held_wall_seconds": 5.642989900021348, - "current_plan_validation_wall_seconds": 0.7296249000355601, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039 - }, - "wall_time_reduction_percent": 5.328606953599968 - } - ] - }, - "combined_prototype_pilot": { - "platform": "Windows", - "python": "3.14.4", - "timings_include_instrumentation": true, - "setup_method": "private locked initialization/reconciliation (issue #54 POC)", - "coordinator_sha256": { - "candidate": "87baa64350e2f36223570ce69ee93927a54146a9bcf62031b5ae4e87ab629ac6" - }, - "samples": [ - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 64, - "current_plans": 11, - "seed_wall_seconds": 8.998478900000919, - "seed_cpu_seconds": 5.4375, - "validation_wall_seconds": 15.910631000006106, - "validation_cpu_seconds": 13.40625, - "reconcile_wall_seconds": 17.71092879999196, - "reconcile_cpu_seconds": 14.71875, - "lock_wait_wall_seconds": 0.23102169996127486, - "registry_lock_held_wall_seconds": 17.686536199995317, - "current_plan_validation_wall_seconds": 0.6708469999721274, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 64, - "path_projections_in_validation": 7621, - "path_projections_total": 8655, - "validation_filesystem_calls": { - "windows_attribute_probes": 84825, - "nt.stat": 7621, - "nt.lstat": 81960, - "nt._getfinalpathname": 15242, - "nt._path_lexists": 14664 - }, - "completed_plans": 11 - } - ], - "medians": [ - { - "retained_claims": 64, - "current_plans": 11, - "candidate": { - "seed_wall_seconds": 8.998478900000919, - "seed_cpu_seconds": 5.4375, - "validation_wall_seconds": 15.910631000006106, - "validation_cpu_seconds": 13.40625, - "reconcile_wall_seconds": 17.71092879999196, - "reconcile_cpu_seconds": 14.71875, - "lock_wait_wall_seconds": 0.23102169996127486, - "registry_lock_held_wall_seconds": 17.686536199995317, - "current_plan_validation_wall_seconds": 0.6708469999721274, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 64, - "path_projections_in_validation": 7621, - "path_projections_total": 8655 - } - } - ] - }, - "final_comparison_py314": { - "platform": "Windows", - "python": "3.14.4", - "timings_include_instrumentation": true, - "setup_method": "private locked initialization/reconciliation (issue #54 POC)", - "coordinator_sha256": { - "baseline": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5", - "candidate": "1b0fb79eae89041c2b4949c713ec66d8d18e28941780a6652ddd6fb619b2bf87" - }, - "samples": [ - { - "revision": "baseline", - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 1.9012400999781676, - "seed_cpu_seconds": 0.9375, - "validation_wall_seconds": 3.637544600002002, - "validation_cpu_seconds": 3.25, - "reconcile_wall_seconds": 5.6222387999878265, - "reconcile_cpu_seconds": 4.546875, - "lock_wait_wall_seconds": 0.24277469993103296, - "registry_lock_held_wall_seconds": 5.599385600013193, - "current_plan_validation_wall_seconds": 0.7571722000138834, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 5821 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.217794900003355, - "seed_cpu_seconds": 1.28125, - "validation_wall_seconds": 3.3006663999985904, - "validation_cpu_seconds": 3.078125, - "reconcile_wall_seconds": 5.230336899985559, - "reconcile_cpu_seconds": 4.34375, - "lock_wait_wall_seconds": 0.2811884998809546, - "registry_lock_held_wall_seconds": 5.200107700016815, - "current_plan_validation_wall_seconds": 0.73309860000154, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 3816 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 1, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 1.8777578000444919, - "seed_cpu_seconds": 1.21875, - "validation_wall_seconds": 3.6942081000306644, - "validation_cpu_seconds": 3.4375, - "reconcile_wall_seconds": 5.43478499999037, - "reconcile_cpu_seconds": 4.921875, - "lock_wait_wall_seconds": 0.2296658999985084, - "registry_lock_held_wall_seconds": 5.412625700002536, - "current_plan_validation_wall_seconds": 0.6629222999908961, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 3816 - }, - "completed_plans": 11 - }, - { - "revision": "baseline", - "repetition": 1, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.1699746000231244, - "seed_cpu_seconds": 1.40625, - "validation_wall_seconds": 2.9540651999996044, - "validation_cpu_seconds": 2.796875, - "reconcile_wall_seconds": 5.100353600049857, - "reconcile_cpu_seconds": 4.046875, - "lock_wait_wall_seconds": 0.24302340002031997, - "registry_lock_held_wall_seconds": 5.073960600013379, - "current_plan_validation_wall_seconds": 0.6219252000446431, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 5821 - }, - "completed_plans": 11 - }, - { - "revision": "baseline", - "repetition": 2, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.3346471000113524, - "seed_cpu_seconds": 1.265625, - "validation_wall_seconds": 3.3979147000354715, - "validation_cpu_seconds": 3.125, - "reconcile_wall_seconds": 5.39498589996947, - "reconcile_cpu_seconds": 4.375, - "lock_wait_wall_seconds": 0.26571340003283694, - "registry_lock_held_wall_seconds": 5.368466199957766, - "current_plan_validation_wall_seconds": 0.706326799991075, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 5821 - }, - "completed_plans": 11 - }, - { - "revision": "candidate", - "repetition": 2, - "retained_claims": 16, - "current_plans": 11, - "seed_wall_seconds": 2.2180932000046596, - "seed_cpu_seconds": 1.15625, - "validation_wall_seconds": 3.4051751000224613, - "validation_cpu_seconds": 3.171875, - "reconcile_wall_seconds": 5.397862699988764, - "reconcile_cpu_seconds": 4.578125, - "lock_wait_wall_seconds": 0.32739230000879616, - "registry_lock_held_wall_seconds": 5.362985200015828, - "current_plan_validation_wall_seconds": 0.7317626000149176, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039, - "validation_filesystem_calls": { - "nt.stat": 2005, - "nt.lstat": 43809, - "nt._getfinalpathname": 4010, - "nt._path_lexists": 3816 - }, - "completed_plans": 11 - } - ], - "medians": [ - { - "retained_claims": 16, - "current_plans": 11, - "baseline": { - "seed_wall_seconds": 2.1699746000231244, - "seed_cpu_seconds": 1.265625, - "validation_wall_seconds": 3.3979147000354715, - "validation_cpu_seconds": 3.125, - "reconcile_wall_seconds": 5.39498589996947, - "reconcile_cpu_seconds": 4.375, - "lock_wait_wall_seconds": 0.24302340002031997, - "registry_lock_held_wall_seconds": 5.368466199957766, - "current_plan_validation_wall_seconds": 0.706326799991075, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039 - }, - "candidate": { - "seed_wall_seconds": 2.217794900003355, - "seed_cpu_seconds": 1.21875, - "validation_wall_seconds": 3.4051751000224613, - "validation_cpu_seconds": 3.171875, - "reconcile_wall_seconds": 5.397862699988764, - "reconcile_cpu_seconds": 4.578125, - "lock_wait_wall_seconds": 0.2811884998809546, - "registry_lock_held_wall_seconds": 5.362985200015828, - "current_plan_validation_wall_seconds": 0.7317626000149176, - "registry_validations": 1, - "registry_scans": 1, - "recorded_plan_loads_in_validation": 16, - "path_projections_in_validation": 2005, - "path_projections_total": 3039 - }, - "wall_time_reduction_percent": -0.053323587357478885 - } - ] - }, - "final_poc_py312_before": { - "os": "Windows", - "python": "3.12.9", - "coordinator_sha256": "d341c1ea25130ea86cfd70fffdf8d44565c569887fe70cfeef4bf2c03439f6c5", - "timings_include_instrumentation": true, - "samples": [ - { - "repetition": 0, - "retained_claims": 0, - "current_plans": 1, - "setup_seconds": 0.034574, - "validation_wall_seconds": 0.018927, - "validation_cpu_seconds": 0.015625, - "reconcile_wall_seconds": 0.139053, - "reconcile_cpu_seconds": 0.078125, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 12, - "_physical_location_key": 9, - "_paths_overlap": 4 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 246, - "own_seconds": 0.011919 - }, - "nt.lstat": { - "calls": 32, - "own_seconds": 0.001631 - }, - "nt._getfinalpathname": { - "calls": 24, - "own_seconds": 0.001635 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 0, - "current_plans": 11, - "setup_seconds": 0.131974, - "validation_wall_seconds": 0.231105, - "validation_cpu_seconds": 0.21875, - "reconcile_wall_seconds": 2.223823, - "reconcile_cpu_seconds": 1.5625, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 132, - "_physical_location_key": 99, - "_paths_overlap": 44 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 2706, - "own_seconds": 0.152611 - }, - "nt.lstat": { - "calls": 342, - "own_seconds": 0.019535 - }, - "nt._getfinalpathname": { - "calls": 264, - "own_seconds": 0.021596 - } - }, - "completed_plans": 11 - }, - { - "repetition": 0, - "retained_claims": 8, - "current_plans": 1, - "setup_seconds": 1.148487, - "validation_wall_seconds": 0.340102, - "validation_cpu_seconds": 0.328125, - "reconcile_wall_seconds": 0.464592, - "reconcile_cpu_seconds": 0.390625, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 229, - "_physical_location_key": 89, - "_paths_overlap": 44, - "_path_key": 56, - "_same_physical_path": 16 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 3802, - "own_seconds": 0.193532 - }, - "nt.lstat": { - "calls": 617, - "own_seconds": 0.035867 - }, - "nt._getfinalpathname": { - "calls": 458, - "own_seconds": 0.03869 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 8, - "current_plans": 11, - "setup_seconds": 1.310114, - "validation_wall_seconds": 2.270882, - "validation_cpu_seconds": 1.90625, - "reconcile_wall_seconds": 4.557809, - "reconcile_cpu_seconds": 3.328125, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 1069, - "_physical_location_key": 819, - "_paths_overlap": 404, - "_path_key": 136, - "_same_physical_path": 16 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 22502, - "own_seconds": 1.451911 - }, - "nt.lstat": { - "calls": 3077, - "own_seconds": 0.215745 - }, - "nt._getfinalpathname": { - "calls": 2138, - "own_seconds": 0.208045 - } - }, - "completed_plans": 11 - }, - { - "repetition": 0, - "retained_claims": 16, - "current_plans": 1, - "setup_seconds": 2.18809, - "validation_wall_seconds": 0.634299, - "validation_cpu_seconds": 0.59375, - "reconcile_wall_seconds": 0.750014, - "reconcile_cpu_seconds": 0.65625, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 445, - "_physical_location_key": 169, - "_paths_overlap": 84, - "_path_key": 112, - "_same_physical_path": 32 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 7346, - "own_seconds": 0.362104 - }, - "nt.lstat": { - "calls": 1201, - "own_seconds": 0.070489 - }, - "nt._getfinalpathname": { - "calls": 890, - "own_seconds": 0.069402 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "setup_seconds": 2.271851, - "validation_wall_seconds": 3.276213, - "validation_cpu_seconds": 2.96875, - "reconcile_wall_seconds": 5.034528, - "reconcile_cpu_seconds": 4.171875, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 2005, - "_physical_location_key": 1539, - "_paths_overlap": 764, - "_path_key": 272, - "_same_physical_path": 32 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 42286, - "own_seconds": 2.008382 - }, - "nt.lstat": { - "calls": 5821, - "own_seconds": 0.30235 - }, - "nt._getfinalpathname": { - "calls": 4010, - "own_seconds": 0.307191 - } - }, - "completed_plans": 11 - } - ], - "progress_demo": { - "production_interval_seconds": 5.0, - "production_max_periodic_reports": null, - "nominal_production_cutoff_seconds": null, - "demo_interval_seconds": 0.01, - "periodic_reports": 26, - "claims_at_last_periodic_report": 40, - "claims_at_completion": 40, - "suppression_message_seen": false, - "completion_message_seen": true - } - }, - "final_poc_py312_after": { - "os": "Windows", - "python": "3.12.9", - "coordinator_sha256": "1b0fb79eae89041c2b4949c713ec66d8d18e28941780a6652ddd6fb619b2bf87", - "timings_include_instrumentation": true, - "samples": [ - { - "repetition": 0, - "retained_claims": 0, - "current_plans": 1, - "setup_seconds": 0.034141, - "validation_wall_seconds": 0.020479, - "validation_cpu_seconds": 0.03125, - "reconcile_wall_seconds": 0.142527, - "reconcile_cpu_seconds": 0.046875, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 12, - "_physical_location_key": 9, - "_paths_overlap": 4 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 246, - "own_seconds": 0.013582 - }, - "nt.lstat": { - "calls": 20, - "own_seconds": 0.00147 - }, - "nt._getfinalpathname": { - "calls": 24, - "own_seconds": 0.001886 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 0, - "current_plans": 11, - "setup_seconds": 0.147965, - "validation_wall_seconds": 0.219711, - "validation_cpu_seconds": 0.203125, - "reconcile_wall_seconds": 2.226259, - "reconcile_cpu_seconds": 1.421875, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 132, - "_physical_location_key": 99, - "_paths_overlap": 44 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 2706, - "own_seconds": 0.147649 - }, - "nt.lstat": { - "calls": 210, - "own_seconds": 0.01315 - }, - "nt._getfinalpathname": { - "calls": 264, - "own_seconds": 0.022254 - } - }, - "completed_plans": 11 - }, - { - "repetition": 0, - "retained_claims": 8, - "current_plans": 1, - "setup_seconds": 1.122367, - "validation_wall_seconds": 0.531479, - "validation_cpu_seconds": 0.390625, - "reconcile_wall_seconds": 0.721315, - "reconcile_cpu_seconds": 0.515625, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 229, - "_physical_location_key": 89, - "_paths_overlap": 44, - "_path_key": 56, - "_same_physical_path": 16 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 3802, - "own_seconds": 0.344879 - }, - "nt.lstat": { - "calls": 388, - "own_seconds": 0.040039 - }, - "nt._getfinalpathname": { - "calls": 458, - "own_seconds": 0.055577 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 8, - "current_plans": 11, - "setup_seconds": 1.292445, - "validation_wall_seconds": 1.848543, - "validation_cpu_seconds": 1.59375, - "reconcile_wall_seconds": 3.941495, - "reconcile_cpu_seconds": 2.921875, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 1069, - "_physical_location_key": 819, - "_paths_overlap": 404, - "_path_key": 136, - "_same_physical_path": 16 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 22502, - "own_seconds": 1.178229 - }, - "nt.lstat": { - "calls": 2008, - "own_seconds": 0.122756 - }, - "nt._getfinalpathname": { - "calls": 2138, - "own_seconds": 0.180689 - } - }, - "completed_plans": 11 - }, - { - "repetition": 0, - "retained_claims": 16, - "current_plans": 1, - "setup_seconds": 1.849587, - "validation_wall_seconds": 0.598632, - "validation_cpu_seconds": 0.546875, - "reconcile_wall_seconds": 0.714918, - "reconcile_cpu_seconds": 0.609375, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 445, - "_physical_location_key": 169, - "_paths_overlap": 84, - "_path_key": 112, - "_same_physical_path": 32 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 7346, - "own_seconds": 0.353687 - }, - "nt.lstat": { - "calls": 756, - "own_seconds": 0.045329 - }, - "nt._getfinalpathname": { - "calls": 890, - "own_seconds": 0.067144 - } - }, - "completed_plans": 1 - }, - { - "repetition": 0, - "retained_claims": 16, - "current_plans": 11, - "setup_seconds": 2.052384, - "validation_wall_seconds": 3.416418, - "validation_cpu_seconds": 2.96875, - "reconcile_wall_seconds": 5.177469, - "reconcile_cpu_seconds": 4.046875, - "validation_operation_counts": { - "registry_validations": 1, - "project_path": 2005, - "_physical_location_key": 1539, - "_paths_overlap": 764, - "_path_key": 272, - "_same_physical_path": 32 - }, - "validation_filesystem_calls": { - "nt.stat": { - "calls": 42286, - "own_seconds": 2.212539 - }, - "nt.lstat": { - "calls": 3816, - "own_seconds": 0.227172 - }, - "nt._getfinalpathname": { - "calls": 4010, - "own_seconds": 0.323864 - } - }, - "completed_plans": 11 - } - ], - "progress_demo": { - "production_interval_seconds": 5.0, - "production_max_periodic_reports": null, - "nominal_production_cutoff_seconds": null, - "demo_interval_seconds": 0.01, - "periodic_reports": 26, - "claims_at_last_periodic_report": 40, - "claims_at_completion": 40, - "suppression_message_seen": false, - "completion_message_seen": true - } - } - } -} diff --git a/docs/registry-validation-results.md b/docs/registry-validation-results.md deleted file mode 100644 index e1c9aea..0000000 --- a/docs/registry-validation-results.md +++ /dev/null @@ -1,153 +0,0 @@ -# Registry validation results (#54) - -These measurements cover the first implementation. The [subsequent optimization -review](registry-validation-refinements.md) records further experiments, the -final retained refinement and its verification. Historical samples remain intact. - -The architecture proposal is in [registry-validation-design.md](registry-validation-design.md). -This is a bounded reduction in physical metadata work, preserving fresh -observations for every comparison. The retained-claim/current-plan cross product -and all path projections remain. It does not claim sublinear registry validation. -Full sanitized samples are in [registry-validation-results.json](registry-validation-results.json). - -## Method and source identity - -Windows, CPython 3.14.4; instrumented local measurements. Baseline is the local -coordinator before this change, with the exact LF-normalized SHA-256 reported -in #54 (`2ff54b69242d46eb8e35a52d30b32bc9afd815c00b6c0abeb8765d6fe7ddbb85`). -No historical checkout reset was needed. Every sample has a new isolated -synthetic registry. Setup uses real private locked initialization/reconciliation; -the measured operation is normal `reconcile_set((), current)`, with all checks -and filesystem calls delegated unchanged. Setup is excluded from validation. -No generated payloads, shared consumer registry or network are involved. - -The issue POC is retained at `tests/registry_validation_poc.py`. Its sample -method is unchanged; progress metadata tolerates the removed lifetime cap, -and the encoding lambda was converted to a function for lint. Repository -formatting also changes presentation without changing the measurement. The -original script remains embedded in issue #54. Both initial matrices used that -original script before those presentation/metadata adaptations. The initial -candidate temporarily retained `MAX_REPORTS` solely as legacy POC metadata; it -was already ignored by the reporting loop. Thus that original candidate JSON's -nominal cutoff field is legacy metadata, not an actual cutoff (26 reports were -observed). The final implementation removes the constant entirely. - -The reusable benchmark now profiles filesystem calls, restores instrumentation -in `finally`, rejects reused sample directories, and supports explicit `--large` -workloads up to 4,096 claims/32 plans. Private seeding avoids quadratic setup -validation, matching the POC; measured reconciliation never skips validation. -`seed_wall_seconds` now includes fixture plan creation. `lock_wait_wall_seconds` -includes preparing and acquiring all lock files (excluding key derivation -between calls); it is not pure kernel blocking. -`registry_lock_held_wall_seconds` measures acquisition to release directly. -Current-plan all-pairs validation is timed outside registry-validation profiling. - -## Original POC matrix - -Single descriptive samples; caches and concurrent workstation activity were not -controlled. All twelve operations completed. Counts combine `nt.stat` and -`nt.lstat`; Python versions can move calls between those two categories. - -| Claims / plans | Baseline validation s | Candidate validation s | Baseline stat+lstat | Candidate stat+lstat | Projections (both) | -| --- | ---: | ---: | ---: | ---: | ---: | -| 0 / 1 | 0.046 | 0.029 | 381 | 246 | 12 | -| 0 / 11 | 0.379 | 0.256 | 4,191 | 2,706 | 132 | -| 8 / 1 | 0.328 | 0.675 | 4,899 | 3,794 | 229 | -| 8 / 11 | 2.212 | 2.098 | 32,729 | 22,494 | 1,069 | -| 16 / 1 | 0.632 | 0.593 | 9,395 | 7,330 | 445 | -| 16 / 11 | 4.094 | 3.674 | 61,145 | 42,270 | 2,005 | - -The 8/1 sample was slower despite fewer probes: single-run wall times are not -a performance gate. The POC's timed validation includes JSON loading, claim/plan -authentication and all comparisons. No JSON or unrelated-claim checks are removed. -Final-path resolutions at 16/11 remain 4,010; projections still dominate much -of the remaining work. Filesystem counts establish the reduced work more reliably -than these timings. - -## Alternating comparison and lock occupancy - -Three alternating baseline/candidate samples, 16 claims/11 plans, with the -maintained benchmark and equal path depth: - -| Measurement | Baseline median | Candidate median | -| --- | ---: | ---: | -| Registry validation | 6.719 s | 4.552 s | -| Validation CPU | 5.438 s | 3.875 s | -| Total reconciliation | 10.468 s | 7.623 s | -| Setup (includes plan creation) | 3.143 s | 2.741 s | -| Registry scans | 1 | 1 | -| Recorded-plan loads during validation | 16 | 16 | -| Projections during validation | 2,005 | 2,005 | -| Validation stat+lstat | 66,272 | 45,814 | - -This is 32.3% lower median registry-validation time and 27.2% lower total time. -Different path depths explain filesystem-count differences from the POC matrix. -One additional pair with direct lock instrumentation measured registry occupancy -7.090 s → 5.586 s, registry validation 4.787 s → 3.575 s, current-plan validation -1.075 s → 0.746 s, and lock acquisition/preparation 0.239 s → 0.273 s. -These are local descriptive results, not a CI timing guarantee. - -## Larger workload and progress - -The 64-claim/11-plan pilot completed with 9.023 s setup, 12.342 s registry -validation and 14.398 s reconciliation. It scanned once, loaded 64 recorded -plans, projected 7,621 paths, and made 174,406 stat+lstat calls. - -The capped 1,024-claim/11-plan run completed: 136.632 s setup, 220.612 s registry -validation (198.672 s CPU), 0.670 s current-plan validation, 222.487 s total -reconciliation, 222.463 s registry-lock occupancy and 0.246 s lock acquisition/ -preparation. It scanned once, loaded all 1,024 recorded plans, projected 119,941 -paths and made 2,746,246 stat+lstat calls plus 239,882 final-path resolutions. -All 11 plans completed. Production progress continued at 65, 120 and 220 seconds -and ended with 1,024/1,024 claims checked. No 2,048-claim or original consumer -benchmark is claimed. This is a completion/scaling sample, not a large baseline -comparison or evidence that the remaining scaling cost is solved. - -The original accelerated POC observed twelve periodic reports and suppression -at baseline. The candidate produced 26 periodic reports through claim 39/40, -no suppression, and a completion message. Scheduling affects the exact count. -Production remains at five-second frequency for the entire operation. Focused -tests also exercise the actual reporter loop beyond twelve intervals without -wall-clock sleeps, while keeping stdout clean and phase/count/timing fields. -The final maintained-POC smoke run confirms null lifetime-cap/cutoff metadata, -26 periodic reports, no suppression and successful completion. - -## Safety and remaining limits - -Claim format, ownership binding, lock ordering/lifetime, reset and crash recovery, -mutation-time path checks and publication transactions are unchanged. Non-following -directory identity replaces `samefile`'s redundant following probes inside -physical containment only. Other uses of `samefile` remain. Alias simulations now -provide matching directory identities as actual physical aliases do. No identity -observations escape one directional comparison; reverse checks remain fresh. - -Filesystem metadata work is linear in ancestry depth within each direction; -materializing missing-suffix tuple prefixes still has quadratic worst-case -Python copying cost in missing depth. Registry cost remains proportional to -retained claims times current plans/targets; large registries can still take -minutes. Arbitrary external topology mutation is not frozen by registry locks. -A future index needs a separately reviewed topology-invalidation design. - -The isolation audit found older default-selector CMake fixtures. They now receive -a per-test cache base, shared across that test's build trees, with a focused -selector regression. Existing explicit lock-root fixtures retain their choice. -No retained shared claims were inspected, classified as stale or removed. -Only sanitized result JSON is suitable for publication; synthetic fixture -directories and raw logs remain ignored and private. - -## Verification - -- `python -m pytest -q -n 4`: **1,721 passed, 41 skipped** (82.44 s), including - coordinator recovery, concurrent writers, alias/ownership and adversarial - topology checks plus the new metadata/progress regressions. -- `ruff check src tests cmake/ProtocyteOutputCoordinator.py`: passed. -- `python -m pytest -q -m cmake_integration tests/test_output_coordinator_cmake.py`: - **16 passed, 1 skipped** (64.25 s), including default-registry isolation, - lock-wait progress forwarding, recovery and competing-build rejection. -- `git diff --check`: passed. -- The original POC matrix, three alternating comparison pairs, direct lock - occupancy pair, 64-claim pilot and capped 1,024-claim run all completed. -- The maintained POC smoke run completed with the final reporter API. - -No C++ files were changed. Cross-platform execution and 2,048+ claim measurements -remain outside this run; timings are not inferred for those cases. diff --git a/docs/wiki/Contributing.md b/docs/wiki/Contributing.md index 8961d46..9e4ce89 100644 --- a/docs/wiki/Contributing.md +++ b/docs/wiki/Contributing.md @@ -64,11 +64,8 @@ python tests/benchmark_output_registry.py --claims 0 8 16 --plans 1 4 --repeat 3 It creates each retained claim through the real coordinator in a fresh private registry and reports seed, registry validation, and reconciliation wall/CPU times -separately. Setup includes plan creation and uses real initialization/reconciliation -helpers under private registry/generation/publication locks; it avoids an -all-pairs setup scan. The measured `reconcile_set` performs every production -check unchanged. It counts registry scans, recorded-plan loads, path projections, -and profiled filesystem calls. It does not generate C++, use the shared registry, or access the +separately. It also counts registry scans, recorded-plan loads, and path +projections. It does not generate C++, use the shared registry, or access the network. The printed temporary directory retains the synthetic state and `results.json`; use `--work NEW_DIRECTORY` to choose that directory explicitly. @@ -78,79 +75,6 @@ sample and median times. Compare operation counts as well as wall times: Windows filesystem probes, path depth, caching, and concurrent machine activity affect timings. The focused regression tests are in `tests/test_output_coordinator.py`. -Filesystem counters include native existence queries on newer Windows Python. -Attribute probes from experimental compared sources are counted separately: -substituting a cheaper query must not be reported as eliminating an observation. - -For a larger sample, explicitly opt in (up to 4,096 claims and 32 plans): - -```bash -python tests/benchmark_output_registry.py --large --claims 2048 --plans 11 --repeat 1 -``` - -Start with 64 claims to estimate cost; large setup and validation may take -minutes. The original issue #54 measurement is also available as -`tests/registry_validation_poc.py`. Publish only scripts and sanitized results; -synthetic fixture records contain local paths and must remain private. CMake -pytest fixtures use a per-test cache base even when exercising the default -registry selector. Retained claims are released only by an ownership-aware -reset, never by age, missing build trees or test-looking names. - -The experimental ownership index supports a `shadow` benchmark mode. It runs -both the sampled preview and the mandatory fresh reference validator; full -validation timings include both. Baseline checkouts use reference mode: - -```bash -python tests/benchmark_output_registry.py --registry-validation shadow --claims 0 8 16 --plans 1 11 --repeat 1 -python tests/registry_validation_poc.py --registry-validation shadow --claims 0 8 16 --plans 1 11 -``` - -The scaling benchmark also accepts `--targets-per-plan 3 --shared-build-root ---existing-directories` to exercise anonymous alternate layouts. Both sides of a -baseline comparison use the same layout. The defaults preserve the original -one-target, separate-build, absent-directory fixture. - -A separate **read-only, non-authoritative** experiment measures only the sampled -algorithm. It performs no fresh registry reference pass after seeding and grants -no authority to reconcile or publish; its timing is not a reconciler speedup: - -```bash -python tests/benchmark_ownership_preview.py --large --claims 2172 --plans 11 --work .pytest-tmp/index-preview-new -``` - -The work directory must be new. The preview supports the same layout flags. -Both tools record the coordinator/helper fingerprints and reject source changes -during a measurement. See the experiment's -[results](../experimental-index-results.md) and -[correctness contract](../experimental-index-contract.md) before interpreting -the preview numbers. That sampled experiment always retains reference authority. -The subsequent committed index remains behind a closed source promotion guard -after the [MR review](../mr55-review-results.md) failed repeat timing. See the -[historical parallel qualification](../parallel-probe-results.md) and -[observation contract](../observation-commit-contract.md). Unsupported or -unverified observations fall back to reference validation. Set -`PROTOCYTE_REGISTRY_VALIDATION=reference` to compare an existing build using the -reference path. - -Actual historical helper/coordinator interoperability checks run separately: - -```console -python tests/verify_coordinator_upgrade.py --work .pytest-tmp/upgrade-new -``` - -That explicit qualifier needs the pinned public source blobs and checkpoints -listed in its source. It checks 115 upgrade, rollback, cleanup and recovery cases -in fresh private registries. Routine unit tests are self-contained and do not -require unmerged branch history, a full checkout or a network fetch. Publish only -the sanitized result receipt, not fixture records or subprocess logs. - -The fresh native-reader investigation can be measured with -`--registry-validation native-shadow` in the scaling benchmark or POC. It keeps -the cross product and fresh physical checks, then always runs reference validation. -Native open/query/close counters and all three source fingerprints are reported. -This mode is an experiment and has not passed the large-workload timing gate; -see [its results and counterexample](../observation-mechanism-results.md). - ## Documentation The canonical wiki source is `docs/wiki/` in the main repository. Edit and diff --git a/docs/wiki/Troubleshooting.md b/docs/wiki/Troubleshooting.md index 6041605..6de2bb8 100644 --- a/docs/wiki/Troubleshooting.md +++ b/docs/wiki/Troubleshooting.md @@ -208,13 +208,11 @@ wait includes preparing and acquiring its lock files. `registry_entries` counts state directories, including any abandoned initialization directories encountered; `claims_checked` counts authenticated claim/plan records. -Registry validation currently uses the full reference validator. The experimental -index remains gated after its repeat timing qualification exceeded 30 seconds; -see the [MR review](../mr55-review-results.md). Existing builds need no migration, -registry reset, or new configuration. To explicitly select the -reference validator while diagnosing an installation, set +Registry validation uses the accelerated validator where supported and falls back +to full validation when needed. Existing builds need no migration, cache reset, +or new configuration. To use the full validator while diagnosing an issue, set `PROTOCYTE_REGISTRY_VALIDATION=reference` in the build environment; remove it to -restore automatic selection, which remains reference while promotion is closed. +restore automatic selection. If cleanup refuses an unsafe path or cannot remove it, the diagnostic warns that inert staging data outside `OUT_DIR` may remain. Stop related processes and remove only the named staging path after inspecting it.