.........................................F.............................. [ 10%] ........................................................................ [ 21%] ........................................................................ [ 31%] ........................................................................ [ 42%] ........................................................................ [ 53%] ........................................................................ [ 63%] .............................................FF......................... [ 74%] ........................................................................ [ 84%] ........................................................................ [ 95%] ............................... [100%] =================================== FAILURES =================================== _______ test_overlay_recovery_rejects_symlink_and_data_inode_replacement _______ tmp_path = PosixPath('/tmp/pytest-of-cube/pytest-7707/test_overlay_recovery_rejects_1') monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x704ea5743e30> def test_overlay_recovery_rejects_symlink_and_data_inode_replacement(tmp_path, monkeypatch): path = tmp_path / "adaptive-overlays.jsonl" journal = OverlayJournal(path, root=tmp_path) journal.append(AdaptiveOverlay("base", "proposal", "2026-07-01T00:00:00+09:00")) complete = path.read_bytes() outside = tmp_path / "outside.jsonl" outside.write_bytes(b"outside") path.unlink() path.symlink_to(outside) outside_before = outside.read_bytes() with pytest.raises(ValueError): journal.recover() assert outside.read_bytes() == outside_before path.unlink() path.write_bytes(complete + b'{"torn":') replacement = tmp_path / "replacement.jsonl" replacement.write_bytes(b"replacement") original_read = journal._read_overlay_rows_locked def replace_data_inode(token, *, allow_truncated_tail): result = original_read(token, allow_truncated_tail=allow_truncated_tail) os.replace(replacement, path) return result monkeypatch.setattr(journal, "_read_overlay_rows_locked", replace_data_inode) with pytest.raises(ValueError, match="unsafe|replaced"): journal.recover() > assert path.read_bytes() == complete + b'{"torn":' E assert b'replacement' == b'{"append_se...0"}\n{"torn":' E E At index 0 diff: b'r' != b'{' E Use -v to get more diff tests/test_adaptive_nutrition.py:945: AssertionError ________ test_wheel_contains_exact_policy_and_installed_resource_bytes _________ tmp_path = PosixPath('/tmp/pytest-of-cube/pytest-7707/test_wheel_contains_exact_poli0') def test_wheel_contains_exact_policy_and_installed_resource_bytes(tmp_path: Path) -> None: raw = POLICY_PATH.read_bytes() assert hashlib.sha256(raw).hexdigest() == EXPECTED_POLICY_SHA256 > wheel = _build_wheel(tmp_path) ^^^^^^^^^^^^^^^^^^^^^^ tests/test_diagnostic_policy_package.py:179: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/test_diagnostic_policy_package.py:98: in _build_wheel subprocess.run( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/home/cube/miniconda3/bin/python', '-m', 'pip', 'wheel', '--no-build-isolation', '--no-cache-dir', ...],) kwargs = {'cwd': PosixPath('/tmp/pytest-of-cube/pytest-7707/test_wheel_contains_exact_poli0/source'), 'env': {'SHELL': '/bin/ba...RTERM': 'truecolor', 'PI_CODING_AGENT': 'true', 'NVM_INC': '/home/cube/.nvm/versions/node/v24.18.1/include/node', ...}} def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout (seconds) is given and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/home/cube/miniconda3/bin/python', '-m', 'pip', 'wheel', '--no-build-isolation', '--no-cache-dir', '--no-deps', '--no-index', '--wheel-dir', '/tmp/pytest-of-cube/pytest-7707/test_wheel_contains_exact_poli0/wheel', '/tmp/pytest-of-cube/pytest-7707/test_wheel_contains_exact_poli0/source']' returned non-zero exit status 1. /home/cube/miniconda3/lib/python3.12/subprocess.py:573: CalledProcessError ----------------------------- Captured stdout call ----------------------------- Processing ./. Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Building wheels for collected packages: physique-checkin-cli Building wheel for physique-checkin-cli (pyproject.toml): started Building wheel for physique-checkin-cli (pyproject.toml): finished with status 'error' Failed to build physique-checkin-cli ----------------------------- Captured stderr call ----------------------------- error: subprocess-exited-with-error × Building wheel for physique-checkin-cli (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [5 lines of output] running bdist_wheel running build running build_py creating build/lib/checkin_cli error: could not create 'build/lib/checkin_cli': Permission denied [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for physique-checkin-cli ERROR: Failed to build one or more wheels _____ test_installed_resource_loader_rejects_missing_and_mismatched_bytes ______ tmp_path = PosixPath('/tmp/pytest-of-cube/pytest-7707/test_installed_resource_loader0') def test_installed_resource_loader_rejects_missing_and_mismatched_bytes(tmp_path: Path) -> None: > wheel = _build_wheel(tmp_path) ^^^^^^^^^^^^^^^^^^^^^^ tests/test_diagnostic_policy_package.py:193: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/test_diagnostic_policy_package.py:98: in _build_wheel subprocess.run( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/home/cube/miniconda3/bin/python', '-m', 'pip', 'wheel', '--no-build-isolation', '--no-cache-dir', ...],) kwargs = {'cwd': PosixPath('/tmp/pytest-of-cube/pytest-7707/test_installed_resource_loader0/source'), 'env': {'SHELL': '/bin/ba...RTERM': 'truecolor', 'PI_CODING_AGENT': 'true', 'NVM_INC': '/home/cube/.nvm/versions/node/v24.18.1/include/node', ...}} def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout (seconds) is given and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/home/cube/miniconda3/bin/python', '-m', 'pip', 'wheel', '--no-build-isolation', '--no-cache-dir', '--no-deps', '--no-index', '--wheel-dir', '/tmp/pytest-of-cube/pytest-7707/test_installed_resource_loader0/wheel', '/tmp/pytest-of-cube/pytest-7707/test_installed_resource_loader0/source']' returned non-zero exit status 1. /home/cube/miniconda3/lib/python3.12/subprocess.py:573: CalledProcessError ----------------------------- Captured stdout call ----------------------------- Processing ./. Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Building wheels for collected packages: physique-checkin-cli Building wheel for physique-checkin-cli (pyproject.toml): started Building wheel for physique-checkin-cli (pyproject.toml): finished with status 'error' Failed to build physique-checkin-cli ----------------------------- Captured stderr call ----------------------------- error: subprocess-exited-with-error × Building wheel for physique-checkin-cli (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [5 lines of output] running bdist_wheel running build running build_py creating build/lib/checkin_cli error: could not create 'build/lib/checkin_cli': Permission denied [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for physique-checkin-cli ERROR: Failed to build one or more wheels =========================== short test summary info ============================ FAILED tests/test_adaptive_nutrition.py::test_overlay_recovery_rejects_symlink_and_data_inode_replacement FAILED tests/test_diagnostic_policy_package.py::test_wheel_contains_exact_policy_and_installed_resource_bytes FAILED tests/test_diagnostic_policy_package.py::test_installed_resource_loader_rejects_missing_and_mismatched_bytes 3 failed, 676 passed in 52.84s