A self-improving RLM agent for coding workflows and long-running autonomous tasks.
Rust
remove unused legacy upgrade helpers and stale evidence
Sebastian Müllerb1917c1a99d0
diff --git a/docs/legacy-upgrade-evidence.md b/docs/legacy-upgrade-evidence.mddeleted file mode 100644index e5e5156132..0000000000--- a/docs/legacy-upgrade-evidence.md+++ /dev/null@@ -1,147 +0,0 @@-# Legacy update compatibility evidence--This is unreleased-candidate evidence, not approval to publish v1. All builds-and runtime tests after the remote-only instruction ran in Prime sandboxes.-Support scope starts at 0.6.0; no earlier versions are required.--## Current verification status--The recovery-hardening snapshot passed the full repository gate, but its real-TS `/update` rerun exposed a request-ID collision after reconnecting: TS replayed-the preparation response instead of executing shutdown. The follow-up uses-distinct preparation and shutdown envelope IDs. A deliberate collision fails-the regression; the fix passes all six coordinator tests. Full gates and actual-migrations for this follow-up remain pending. Earlier results below are not-attributed to the latest source.--The consolidated full run encountered `ETXTBSY` (text file busy) in the existing-`update::download::tests::stages_a_local_payload_directory` test. A diagnostic-single-test run and the complete core library suite then passed (1,160 passed,-3 ignored), without product changes or retry logic. The cause is unproven; the-original failure is retained in `make-check-hardened-etxtbsy-red.log`. One fresh-full run passed; this does not by itself establish that the failure is fixed.--| Check | Verified result |-| --- | --- |-| npm CLI and TUI migration, all 18 stable TS versions | 36/36 on optimized candidate before final recovery hardening |-| Native CLI and TUI migration, TS 0.9.5–0.9.8 | 8/8 on that optimized candidate |-| Subsequent Rust 1.0.0 → 1.0.1 update | Passed through the original custom public command |-| Fresh curl installation and reinstallation | Passed with final staged-probe installer |-| Unusable native executable | Red reproduced; fixed installer retained usable TS recovery |-| Failed migration followed by a newer release | Original update command reached Rust 1.0.1 |-| Lost prepare response and retained queued work | Six focused coordinator tests passed; red-first regression reproduced |-| Startup cleanup preserves pending recovery manifests | Two focused tests passed |-| Busy-session continuation before follow-up input | Real worker regression reproduced red; 19 focused restore tests passed |-| npm bridge unit suite | 25 passed, including IPC, fd3, signals, retry, and prefix behavior |-| Packaging suites | 39 passed: native compatibility, restamping, decoder, catalog |-| Consolidated full repository gate | fmt, clippy, 5,206 tests passed (19 ignored), release build passed |--## Published-version matrix--The npm runs use unchanged, checksum-verified published packages and their real-public CLI/TUI entrypoints. Every version below passed both commands.--| Versions | CLI cases | TUI cases |-| --- | ---: | ---: |-| 0.6.0, 0.6.1 | 2 | 2 |-| 0.7.0–0.7.4 | 5 | 5 |-| 0.8.0, 0.8.1 | 2 | 2 |-| 0.9.0–0.9.8 | 9 | 9 |--Native installs additionally cover every stable native TS release,-0.9.5–0.9.8, using each archive's unchanged old installer.-The TUI runs require completed restoration, the original saved session attached-to a Rust worker, a preserved transcript prefix, responsive input, and no-restart warnings. CLI checks include version/help, checksum refusal, state-preservation, and paths with spaces.--The optimized Linux x64 snapshot tested before final recovery hardening:--- Rust 1.0.0 archive: `7a5e663b535d1755504f8315d4f13de0857ed746ac5c6fdc6c5e55db84ec11b3`.-- Rust 1.0.1 archive: `f46a36e1456dc6d7ddfefaf85bad68b29a0b06d863cb1577ce5e3445d4cad97a`.-- Shipped executable: `0dbfb29af17614870f613017de2c6a11b25aa80572390a61dbe4d42c36335227`.--Independent source archive digests and the exact version inventory live in-[legacy-release-inventory.json](legacy-release-inventory.json).-[The compatibility contract](legacy-upgrade-contract.md) describes the layouts,-wire fields, and required recovery behavior.--## Failure and usability evidence--**Unusable executable:** the actual TS 0.6.0 updater installed a checksum-valid-archive whose native executable named a nonexistent interpreter. With the-old probe condition, the npm launcher was replaced and the command exited 127.-With the fix, the staged probe refused activation, retained the npm symlink,-wrote no success receipt, and left a genuine TS 0.9.8 daemon/worker able to-resume the original session and accept input. The npm/native prefixes overlapped.--**Future retry:** after an unsupported architecture caused migration to fail,-the feed advanced from 1.0.0 to 1.0.1 and host support was restored. The original-public update command fetched the new bridge and installer, activated Rust-1.0.1, and resumed the saved session. An explicit retry that remains unsupported-must still fail, despite the old TS updater's warning-only success exit.--**Lost response:** a Unix-socket protocol fixture writes a TS-shaped manifest-containing queued work, then drops the prepare reply. The Rust coordinator-recovers it through its durable predecessor/socket/attempt binding before-shutdown. Disabling recovery makes the regression fail. Tests reject foreign-owners and stale data and permit retry after a definitive preparation refusal.-Startup cleanup preserves pending source manifests until adoption.--**Busy queue:** a real scheduled Rust worker with a scripted engine proves that-restored follow-up input stays parked until continuation admission. Disabling-the input pause consumes the queue too early; restoring it passes.--**Usability:** separate real TS 0.6.0 npm and TS 0.9.8 native handoffs execute-and persist a controlled Bash command after restoration, preserving prior-transcript bytes. No provider inference or IPython execution was tested.--The genuine fallback is the complete published TS 0.9.8 package, pinned to-SHA-256 `d7b72785119efc28bfbca8ec4a7f47a1fcdcf47fcd8cebdb60bffaa79e3e1274`.-The final staged-probe installer tested here is-`323328cea0ede4d60aedfef486ba383ea081457e65ccedb1782ca6a0575a7f09`.--## Reproduction and retained reports--Run these only in an isolated test host, with temporary homes and no real-credentials. Harnesses accept candidate archives and report paths; use their-`--help` for the published source archive/checksum/prefix arguments.--| Harness | Purpose |-| --- | --- |-| `scripts/release/verify_legacy_release.py` | Download and verify a genuine native TS release, then exercise its updater |-| `scripts/release/test_legacy_upgrade.py` | Native CLI, checksum refusal, custom paths, second Rust update |-| `scripts/release/test_legacy_npm_upgrade.py` | Genuine npm CLI migration |-| `scripts/release/test_legacy_tui_upgrade.py` | Actual npm/native TUI update with saved-session restoration |-| `scripts/release/test_legacy_npm_fallback.py` | Unsupported host, unusable payload, and later-release recovery |-| `scripts/release/test_legacy_runtime_restart.py` | Real post-migration worker command execution |-| `scripts/release/test_channel_install.py` | Current curl installer, reinstall, and user-file preservation |--Reports, hashes, TUI captures, and logs were downloaded without agent binaries-to `/tmp/prime-legacy-artifacts/` in the maintainer workspace. Key reports:-`native-upgrade-evidence-optimized.tar.gz`, `native-tui-optimized-0.9.{5,6,7,8}.json`,-`channel-install-probe-final.json`, `probe-red.json`, `probe-green.json`,-`future-release-recovery.json`, `legacy-recovery-red-green.tar.gz`, and-`make-check-hardened.log`. Matrix bundles contain each case's exact archive and-bridge hashes. Intermediate evidence remains in Git history and-`evidence-history-before-condensing.md` beside the raw reports.--## Remaining release gates and limits--- Complete full gates and the migration matrix against the corrected optimized artifact.-- Verify production artifacts on all supported hosts. The Linux candidate was- built on Debian 12 with fixture catalog data. Its highest required GLIBC- symbol is 2.34, but that is not an Ubuntu 22.04 runtime test.-- Stable release CI builds and livechecks Linux x64/arm64 in pinned Ubuntu 22.04,- and gates fresh installation plus TS migration on Linux and macOS arm64.- macOS x64 currently has a Rosetta version probe, not a full migration gate.-- Older macOS arm64 CLI runs, two Rust beta CLI runs, and retained TS prerelease- runs passed earlier snapshots; they do not establish final platform coverage- or coverage of every historical beta.-- GNU binaries do not establish musl, older-glibc, or unsupported-CPU support.- A working TS fallback is not a successful Rust migration.-- npm was integration-tested; pnpm, Yarn, and Bun were not. Beta artifact reuse- does not execute the new fresh-install gate.-- No final live-catalog, public stable endpoint, release-tag, or publication- verification is claimed. Full rendered-frame and exhaustive wire-byte parity- were not measured; the unchanged TS clients exercise the actual handoff.diff --git a/scripts/release/test_legacy_npm_fallback.py b/scripts/release/test_legacy_npm_fallback.pydeleted file mode 100644index e172e274be..0000000000--- a/scripts/release/test_legacy_npm_fallback.py+++ /dev/null@@ -1,228 +0,0 @@-#!/usr/bin/env python3-"""Real npm updater recovery when the unchanged Rust installer rejects a host.--Opt-in network integration. All installs, sockets, and sessions are temporary.-The only simulated host capability is uname -m; no installer or TS code is mocked.-"""-from __future__ import annotations--import argparse-import io-import json-import os-from pathlib import Path-import shlex-import shutil-import signal-import subprocess-import tarfile-import tempfile--import npm_bridge-from test_legacy_tui_upgrade import daemon_request, wait_for-from test_legacy_upgrade import archive_identity, digest, execute, isolated_environment, publish_archive, release_server---def exercise(args, root: Path) -> dict:- source = args.previous_archive- with tarfile.open(source) as tar:- metadata = json.load(tar.extractfile("package/package.json"))- original_cli = tar.extractfile("package/dist/bundle/cli.js").read()- checksum = next(line.split()[0] for line in args.previous_checksums.read_text().splitlines()- if len(line.split()) == 2 and line.split()[1].lstrip("*") == source.name)- assert digest(source) == checksum- version, platform = archive_identity(args.archive)- candidate = args.archive- if args.failure_mode == "unusable-payload":- # Valid archive and matching published checksum, but execution fails- # on every host. Keep its executable mode so the staged --version- # probe, rather than the presence check, must reject publication.- candidate = root / args.archive.name- with tarfile.open(args.archive) as source_archive, tarfile.open(candidate, "w:gz") as rejected:- for member in source_archive.getmembers():- if member.name == "prime-agent":- payload = b"#!/nonexistent-prime-agent-test-interpreter\n"- member.size = len(payload)- member.mode = 0o755- rejected.addfile(member, io.BytesIO(payload))- else:- rejected.addfile(member, source_archive.extractfile(member) if member.isfile() else None)- feed = root / "feed"- publish_archive(feed, candidate)- bridge = npm_bridge.assemble(Path(__file__).resolve().parents[2], feed / "releases" / f"v{version}",- version, "stable", args.fallback_tarball)- (feed / "latest.json").write_text(json.dumps({"version": version, "package": "prime-agent",- "tarball": f"releases/v{version}/{bridge['tarball']}",- "binaries": [{"platform": platform, "file": candidate.name, "sha256": digest(candidate)}]}))- evidence = {"source_version": metadata["version"], "source_sha256": checksum,- "candidate_sha256": digest(candidate), "failure_mode": args.failure_mode,- "bridge_sha256": bridge["sha256"],- "fallback_sha256": digest(args.fallback_tarball), "steps": []}- with release_server(feed) as base:- env = isolated_environment(root / "user", base, "standard")- prefix = root / "npm prefix"- shutil.copytree(args.previous_prefix, prefix, symlinks=True)- public = prefix / "bin/prime-agent"- cli = prefix / "lib/node_modules/prime-agent/dist/bundle/cli.js"- assert cli.read_bytes() == original_cli- wrappers = root / "host"- wrappers.mkdir()- if args.failure_mode == "unsupported-host":- uname = wrappers / "uname"- uname.write_text('#!/bin/sh\nif [ "$1" = -m ]; then echo unsupported-test-architecture; else exec /usr/bin/uname "$@"; fi\n')- uname.chmod(0o755)- native_prefix = prefix if args.failure_mode == "unusable-payload" else root / "rust"- socket = root / "daemon.sock"- env.update(PATH=str(wrappers) + os.pathsep + str(prefix / "bin") + os.pathsep + env["PATH"],- npm_config_prefix=str(prefix), npm_config_cache=str(root / "npm-cache"),- npm_config_ignore_scripts="true", npm_config_audit="false", npm_config_fund="false",- npm_config_update_notifier="false", PRIME_AGENT_RUST_PREFIX=str(native_prefix),- PRIME_AGENT_ALLOW_HTTP="1", PRIME_AGENT_DAEMON_SOCKET=str(socket),- TERM="xterm-256color", ANTHROPIC_API_KEY="fixture-not-a-real-key")- state = Path(env["PRIME_AGENT_CODING_AGENT_DIR"])- (state / "settings.json").write_text(json.dumps({"onboardingShown": True}))- stamp = "2026-10-09T00:00:00.000Z"- transcript = state / "sessions/recovery.jsonl"- transcript.parent.mkdir(exist_ok=True)- rows = [{"type": "session", "version": 3, "id": "11111111-2222-4333-8444-555555555555", "timestamp": stamp, "cwd": env["HOME"]},- {"type": "message", "id": "seed", "parentId": None, "timestamp": stamp, "message": {- "role": "assistant", "content": [{"type": "text", "text": "durable recovery sentinel"}],- "api": "anthropic-messages", "provider": "anthropic", "model": "claude-sonnet-4-5",- "usage": {"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 0,- "cost": {"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0}},- "stopReason": "stop", "timestamp": 1791504000000}}]- original = "".join(json.dumps(row) + "\n" for row in rows)- transcript.write_text(original)- evidence["steps"].append(execute([str(public), "--version"], env))- update = subprocess.run([str(public), "update", "--force"], env=env, cwd=env["HOME"],- capture_output=True, text=True, timeout=240)- evidence["old_update"] = {"exit_code": update.returncode, "stdout": update.stdout, "stderr": update.stderr}- assert json.loads((cli.parents[2] / "package.json").read_text())["primeAgentRustBridge"] is True- probe = execute([str(public), "--version"], env)- evidence["steps"].append(probe)- assert npm_bridge.FALLBACK_VERSION in (probe["stdout"] + probe["stderr"]).splitlines(), probe- assert "TypeScript" in probe["stderr"], probe- assert not (native_prefix / "share/prime-agent/prime-agent").exists(), "Unusable native payload was published"- assert public.is_symlink() and public.resolve() == cli.resolve(), "Installer overwrote the public npm recovery launcher"- receipts = native_prefix / "share/.prime-agent-npm-bridge"- assert not (receipts / version).exists(), "Failed migration recorded success"- assert (receipts / f"{version}.failed").exists(), "Failed migration was not recorded"- expected_runtime = npm_bridge.FALLBACK_VERSION- if args.recovery_archive:- if args.failure_mode != "unsupported-host":- raise ValueError("A recovery archive currently requires unsupported-host mode")- recovery_version, recovery_platform = archive_identity(args.recovery_archive)- assert recovery_version != version- publish_archive(feed, args.recovery_archive)- recovery_bridge = npm_bridge.assemble(Path(__file__).resolve().parents[2],- feed / "releases" / f"v{recovery_version}", recovery_version, "stable", args.fallback_tarball)- (feed / "latest.json").write_text(json.dumps({"version": recovery_version, "package": "prime-agent",- "tarball": f"releases/v{recovery_version}/{recovery_bridge['tarball']}",- "binaries": [{"platform": recovery_platform, "file": args.recovery_archive.name,- "sha256": digest(args.recovery_archive)}]}))- (wrappers / "uname").unlink()- expected_runtime = recovery_version- evidence["recovery"] = {"version": recovery_version, "candidate_sha256": digest(args.recovery_archive),- "bridge_sha256": recovery_bridge["sha256"]}- retry = subprocess.run([str(public), "update", "--force"], env=env, cwd=env["HOME"],- capture_output=True, text=True, timeout=90)- evidence["explicit_retry"] = {"exit_code": retry.returncode, "stdout": retry.stdout, "stderr": retry.stderr}- if args.recovery_archive:- assert retry.returncode == 0, evidence["explicit_retry"]- assert (receipts / expected_runtime).is_file(), "Newer release did not record successful migration"- assert (native_prefix / "share/prime-agent/prime-agent").is_file()- recovered = execute([str(public), "--version"], env)- evidence["steps"].append(recovered)- assert recovered["stdout"].strip() == expected_runtime, recovered- else:- assert retry.returncode != 0 and "Rust migration failed" in retry.stderr, evidence["explicit_retry"]- expected_error = "no rust build is published" if args.failure_mode == "unsupported-host" else "refusing an unusable launcher"- assert expected_error in retry.stderr, evidence["explicit_retry"]- tmux = ["tmux", "-S", str(root / "tmux.sock")]-- def tmux_run(*parts):- return subprocess.run(tmux + list(parts), env=env, capture_output=True, text=True, timeout=10)-- def screen():- result = tmux_run("capture-pane", "-p", "-t", "recovery")- if result.returncode:- raise RuntimeError(result.stderr)- return result.stdout-- try:- command = [str(public), "--resume", str(transcript), "--daemon-socket", str(socket),- "--provider", "anthropic", "--model", "claude-sonnet-4-5"]- tmux_run("new-session", "-d", "-s", "recovery", "-x", "120", "-y", "36", "-c", env["HOME"], shlex.join(command)).check_returncode()- wait_for("genuine TS fallback session", lambda: "durable recovery sentinel" in screen())- hello, roster = daemon_request(socket, {"type": "list"})- assert hello["appVersion"] == expected_runtime, hello- wait_for("persisted session attachment", lambda: any(- session.get("sessionFile") == str(transcript) and session.get("attachedClients", 0) > 0- for session in daemon_request(socket, {"type": "list"})[1].get("data", {}).get("sessions", [])))- tmux_run("send-keys", "-t", "recovery", "-l", "recovery-input-witness").check_returncode()- wait_for("responsive fallback input", lambda: "recovery-input-witness" in screen())- assert transcript.read_text().startswith(original)- evidence.update(status="passed", fallback_hello=hello, fallback_roster=roster,- responsive_screen=screen(), transcript_preserved=True)- finally:- # Track the fixture's daemon, worker, and inherited bootstrap children- # before shutdown; they must stop writing before deleting their home.- owned = set()- namespace = f"PRIME_AGENT_CODING_AGENT_DIR={state}".encode()- for process in Path("/proc").iterdir():- if process.name.isdigit():- try:- if namespace in (process / "environ").read_bytes().split(b"\0"):- owned.add(int(process.name))- except (OSError, PermissionError):- pass- tmux_run("kill-server")- try:- daemon_request(socket, {"type": "shutdown", "force": True})- except (OSError, RuntimeError, ValueError):- pass-- def alive():- running = []- for pid in owned:- try:- stat = Path(f"/proc/{pid}/stat").read_text()- if stat.rsplit(")", 1)[1].split()[0] != "Z":- running.append(pid)- except FileNotFoundError:- pass- return running-- try:- wait_for("fixture daemon and worker shutdown", lambda: not alive(), timeout=20)- except RuntimeError:- # A failed verifier must still release only its isolated children.- for pid in alive():- try:- os.kill(pid, signal.SIGKILL)- except ProcessLookupError:- pass- wait_for("forced fixture cleanup", lambda: not alive(), timeout=10)- raise- return evidence---def main() -> int:- parser = argparse.ArgumentParser(description=__doc__)- parser.add_argument("--recovery-archive", type=Path)- parser.add_argument("--failure-mode", choices=("unsupported-host", "unusable-payload"), default="unsupported-host")- for name in ("previous-archive", "previous-checksums", "previous-prefix", "fallback-tarball", "archive", "report"):- parser.add_argument("--" + name, type=Path, required=True)- args = parser.parse_args()- with tempfile.TemporaryDirectory(prefix="pfail-", dir="/tmp") as directory:- try:- report = exercise(args, Path(directory))- except Exception as error:- report = {"status": "failed", "error": str(error)}- args.report.write_text(json.dumps(report, indent=2) + "\n")- print(json.dumps(report, indent=2))- return int(report["status"] != "passed")---if __name__ == "__main__":- raise SystemExit(main())diff --git a/scripts/release/test_legacy_npm_upgrade.py b/scripts/release/test_legacy_npm_upgrade.pydeleted file mode 100644index 2e99fcd14c..0000000000--- a/scripts/release/test_legacy_npm_upgrade.py+++ /dev/null@@ -1,124 +0,0 @@-#!/usr/bin/env python3-"""Opt-in integration test: published TS npm CLI -> Rust bridge -> real Rust.--Supply a released npm tarball and its SHA256SUMS, a candidate native archive,-and optionally a prepared npm prefix to avoid reinstalling historical deps.-Dependency installation needs network; the actual update uses only localhost.-No npm lifecycle scripts execute, and every installation/state path is isolated.-"""-from __future__ import annotations--import argparse-import json-import os-from pathlib import Path-import shutil-import subprocess-import tarfile-import tempfile--import npm_bridge-from test_legacy_upgrade import archive_identity, digest, execute, isolated_environment, publish_archive, release_server---def exercise(args, root: Path) -> dict:- archive = args.previous_archive.resolve()- checksum = next((line.split()[0] for line in args.previous_checksums.read_text().splitlines()- if len(line.split()) == 2 and line.split()[1].lstrip('*') == archive.name), None)- if checksum != digest(archive):- raise ValueError('Historical npm artifact checksum mismatch')- with tarfile.open(archive) as package:- source = json.load(package.extractfile('package/package.json'))- assert source['name'] == 'prime-agent'- source_entrypoint = source['bin']['prime-agent']- if source_entrypoint not in ('dist/cli.js', 'dist/bundle/cli.js'):- raise ValueError(f'Unknown historical entrypoint: {source_entrypoint}')- version, platform = archive_identity(args.archive)- feed = root / 'feed'- publish_archive(feed, args.archive)- release = feed / 'releases' / f'v{version}'- channel = 'beta' if '-beta' in source['version'] else 'stable'- bridge = npm_bridge.assemble(Path(__file__).resolve().parents[2], release, version, channel, args.fallback_tarball)- manifest = {'version': version, 'package': 'prime-agent',- 'tarball': f'releases/v{version}/{bridge["tarball"]}',- 'binaries': [{'platform': platform, 'file': args.archive.name, 'sha256': digest(args.archive)}]}- (feed / ('beta.json' if channel == 'beta' else 'latest.json')).write_text(json.dumps(manifest))- steps = []- with release_server(feed) as base:- env = isolated_environment(root / 'user', base)- prefix = root / 'npm prefix'- if args.previous_prefix:- shutil.copytree(args.previous_prefix, prefix, symlinks=True)- env.update({'npm_config_prefix': str(prefix), 'npm_config_cache': str(root / 'npm cache'),- 'npm_config_ignore_scripts': 'true', 'npm_config_audit': 'false', 'npm_config_fund': 'false',- 'npm_config_update_notifier': 'false',- 'PRIME_AGENT_RUST_PREFIX': str(root / 'rust prefix'), 'PRIME_AGENT_ALLOW_HTTP': '1',- 'PRIME_AGENT_DAEMON_SOCKET': str(root / 'daemon.sock')})- env['PATH'] = str(prefix / 'bin') + os.pathsep + env['PATH']- if not args.previous_prefix:- steps.append(execute(['npm', 'install', '-g', str(archive)], env))- package_dir = prefix / 'lib/node_modules/prime-agent'- cli = package_dir / source_entrypoint- with tarfile.open(archive) as package:- assert cli.read_bytes() == package.extractfile(f'package/{source_entrypoint}').read(), 'Prepared prefix is not the supplied released CLI'- old = execute(['node', str(cli), '--version'], env)- assert (old['stdout'] + old['stderr']).strip() == source['version'], old- steps.append(old)- state = Path(env['PRIME_AGENT_CODING_AGENT_DIR'])- witness = state / 'skills/upgrade-witness/SKILL.md'- witness.parent.mkdir(parents=True)- witness.write_text('# Preserve this skill\n')- update = execute(['node', str(cli), 'update', '--force'], env)- steps.append(update)- # The old updater launches the bridge as its coordinator. No manual- # curl/reinstall/bridge invocation is permitted before this assertion.- # Some earliest clients never relaunch; their explicit opt-in case- # verifies activation through the next ordinary version command.- native = Path(env['PRIME_AGENT_RUST_PREFIX']) / 'bin/prime-agent'- activated_during_update = native.is_file()- if not activated_during_update and not args.allow_deferred_activation:- diagnostic = subprocess.run(['node', str(cli), '--version'], env=env, cwd=env['HOME'], capture_output=True, text=True, timeout=180)- raise RuntimeError(json.dumps({'message': 'Old update did not activate the Rust installation', 'steps': steps, 'bridge_diagnostic': {'exit_code': diagnostic.returncode, 'stdout': diagnostic.stdout, 'stderr': diagnostic.stderr}}, indent=2))- assert 'could not coordinate' not in update['stderr'].lower(), update- assert 'could not restart' not in update['stderr'].lower(), update- probe = execute(['node', str(cli), '--version'], env)- assert probe['stdout'].strip() == version, probe- assert native.is_file(), 'Normal relaunch did not activate Rust'- steps.append(probe)- steps.append(execute(['node', str(cli), '--help'], env))- assert witness.read_text() == '# Preserve this skill\n'- assert json.loads((package_dir / 'package.json').read_text())['primeAgentRustBridge'] is True- return {'status': 'passed', 'source_version': source['version'], 'target_version': version,- 'source_sha256': checksum, 'activation': 'during update' if activated_during_update else 'first normal relaunch',- 'source_entrypoint': source_entrypoint, 'channel': channel, 'candidate_sha256': digest(args.archive),- 'bridge_sha256': bridge['sha256'], 'coverage': ['real published npm CLI update', 'bridge relaunch',- 'Rust activation', 'version/help', 'user skill preservation', 'paths with spaces'],- 'not_covered': ['TUI /update', 'running daemon handoff', 'session continuation', 'kernel bootstrap', 'second Rust update'], 'steps': steps}---def main() -> int:- parser = argparse.ArgumentParser(description=__doc__)- parser.add_argument('--previous-archive', type=Path, required=True)- parser.add_argument('--previous-checksums', type=Path, required=True)- parser.add_argument('--previous-prefix', type=Path)- parser.add_argument('--archive', type=Path, required=True)- parser.add_argument('--fallback-tarball', type=Path, required=True)- parser.add_argument('--allow-deferred-activation', action='store_true',- help='Older updaters without a coordinator may activate Rust on the next normal command')- parser.add_argument('--report', type=Path)- args = parser.parse_args()- args.archive = args.archive.resolve()- with tempfile.TemporaryDirectory(prefix='pa-npm-', dir='/tmp') as directory:- try:- report = exercise(args, Path(directory))- except (AssertionError, OSError, RuntimeError, ValueError, subprocess.SubprocessError) as error:- report = {'status': 'failed', 'error': str(error)}- rendered = json.dumps(report, indent=2)- if args.report:- args.report.write_text(rendered + '\n')- print(rendered)- return int(report['status'] != 'passed')---if __name__ == '__main__':- raise SystemExit(main())diff --git a/scripts/release/test_legacy_runtime_restart.py b/scripts/release/test_legacy_runtime_restart.pydeleted file mode 100644index 6bdfc1e147..0000000000--- a/scripts/release/test_legacy_runtime_restart.py+++ /dev/null@@ -1,241 +0,0 @@-#!/usr/bin/env python3-"""Exercise a shipped TS daemon's post-install coordinator against a Rust candidate.--This launches no model inference. All homes, sockets, and daemon ownership-registries are temporary. Run in a disposable Prime sandbox.-"""-import argparse-import json-import os-from pathlib import Path-import signal-import shutil-import socket-import subprocess-import tarfile-import tempfile-import threading-import time---def connect(path):- stream = socket.socket(socket.AF_UNIX)- stream.settimeout(30)- try:- stream.connect(str(path))- reader = stream.makefile("r")- hello = json.loads(reader.readline())- return stream, reader, hello- except BaseException:- stream.close()- raise---def request(path, command):- stream, reader, hello = connect(path)- try:- stream.sendall((json.dumps({"type": "command", "id": "probe", "protocol": hello["protocol"],- "command": command}) + "\n").encode())- while line := reader.readline():- frame = json.loads(line)- if frame.get("type") == "response" and frame.get("id") == "probe":- if not frame.get("success"):- raise RuntimeError(frame)- return frame.get("data")- raise RuntimeError("daemon disconnected before response")- finally:- reader.close()- stream.close()---def await_hello(path, child):- deadline = time.monotonic() + 30- while True:- try:- stream, reader, hello = connect(path)- reader.close()- stream.close()- return hello- except (OSError, ValueError):- if child.poll() is not None or time.monotonic() >= deadline:- raise RuntimeError("old daemon did not become ready")- time.sleep(0.05)---def stop_fixture_processes(home):- """Stop only Linux processes that carry this fixture's unique HOME."""- if not Path("/proc").is_dir():- return- expected = f"HOME={home}".encode()- deadline = time.monotonic() + 10- while True:- matched = []- for entry in Path("/proc").iterdir():- if not entry.name.isdigit() or int(entry.name) == os.getpid():- continue- try:- if expected in (entry / "environ").read_bytes().split(b"\0"):- matched.append(entry)- except (FileNotFoundError, ProcessLookupError, PermissionError):- continue- if not matched:- return- for entry in matched:- try:- # Recheck after enumeration so a reused PID cannot be signalled.- if expected in (entry / "environ").read_bytes().split(b"\0"):- os.kill(int(entry.name), signal.SIGKILL if time.monotonic() > deadline - 5 else signal.SIGTERM)- except (FileNotFoundError, ProcessLookupError, PermissionError):- pass- if time.monotonic() >= deadline:- raise RuntimeError("fixture processes did not terminate")- time.sleep(0.05)---def main():- parser = argparse.ArgumentParser(description=__doc__)- parser.add_argument("--legacy-archive", type=Path)- parser.add_argument("--legacy-npm-prefix", type=Path)- parser.add_argument("--node", default="node")- parser.add_argument("--candidate-archive", type=Path)- parser.add_argument("--candidate-binary", type=Path)- parser.add_argument("--with-session", action="store_true")- parser.add_argument("--report", type=Path, required=True)- options = parser.parse_args()- if bool(options.legacy_archive) == bool(options.legacy_npm_prefix):- parser.error("choose one legacy native archive or installed npm prefix")- if bool(options.candidate_archive) == bool(options.candidate_binary):- parser.error("choose one candidate archive or candidate binary")- evidence = {}- with tempfile.TemporaryDirectory(prefix="legacy-runtime-") as directory:- root = Path(directory)- old_dir, candidate_dir = root / "ts", root / "rust"- if options.legacy_archive:- old_dir.mkdir()- with tarfile.open(options.legacy_archive) as archive:- archive.extractall(old_dir, filter="data")- old_command = [str(old_dir / "prime-agent")]- else:- shutil.copytree(options.legacy_npm_prefix, old_dir, symlinks=True)- old_command = [options.node, str(old_dir / "lib/node_modules/prime-agent/dist/bundle/cli.js")]- if options.candidate_archive:- candidate_dir.mkdir()- with tarfile.open(options.candidate_archive) as archive:- archive.extractall(candidate_dir, filter="data")- candidate = candidate_dir / "prime-agent"- else:- candidate = options.candidate_binary.resolve()- home, agent, temporary = root / "home", root / "agent", root / "tmp"- for path in (home, agent / "update-restarts", temporary):- path.mkdir(parents=True)- endpoint = temporary / "daemon.sock"- env = dict(os.environ)- for key in list(env):- if key.startswith(("PI_", "PRIME_AGENT_")):- del env[key]- env.update(HOME=str(home), TMPDIR=str(temporary), DO_NOT_TRACK="1",- XDG_CONFIG_HOME=str(home / ".config"), XDG_DATA_HOME=str(home / ".local/share"),- XDG_CACHE_HOME=str(home / ".cache"),- PRIME_AGENT_CODING_AGENT_DIR=str(agent), PRIME_AGENT_OFFLINE="1",- PRIME_AGENT_INTERNAL_DAEMON_SUPERVISOR_REGISTRY_DIR=str(root / "owners"))- with (root / "old.log").open("w") as log:- old = subprocess.Popen(old_command + ["--mode", "daemon", "--daemon-socket", str(endpoint)],- env=env, cwd=root, stdout=log, stderr=subprocess.STDOUT)- threading.Thread(target=old.wait, daemon=True).start()- successor_pid = None- try:- evidence["predecessor"] = await_hello(endpoint, old)- transcript = None- if options.with_session:- # Seed an existing transcript: TS deliberately buffers a brand- # new session until its first assistant message exists.- transcript = agent / "sessions" / "migration.jsonl"- transcript.parent.mkdir(exist_ok=True)- stamp = "2026-10-09T00:00:00.000Z"- rows = [- {"type":"session","version":3,"id":"11111111-2222-4333-8444-555555555555","timestamp":stamp,"cwd":str(root)},- {"type":"message","id":"seed-assistant","parentId":None,"timestamp":stamp,"message":{- "role":"assistant","content":[{"type":"text","text":"durable migration sentinel"}],- "api":"openai-completions","provider":"openai","model":"gpt-4o-mini",- "usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,- "cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},- "stopReason":"stop","timestamp":1791504000000}},- ]- transcript.write_text("".join(json.dumps(row)+"\n" for row in rows))- created = request(endpoint, {"type": "create", "sessionPath":str(transcript), "config": {- "cwd": str(root), "agentDir": str(agent), "provider": "openai", "model": "gpt-4o-mini",- "noExtensions": True, "noSkills": True, "noContextFiles": True, "telemetryDisabled": True}})- evidence["created_session"] = created- request(endpoint, {"type": "append_custom_message", "activeSessionId": created["activeSessionId"],- "message": {"customType": "migration-test", "content": "live TS checkpoint sentinel",- "display": True, "timestamp": int(time.time() * 1000)}})- transcript = Path(created["sessionFile"])- deadline = time.monotonic() + 10- while True:- before = transcript.read_text()- if "live TS checkpoint sentinel" in before:- break- if time.monotonic() >= deadline:- raise RuntimeError("TS session did not persist the custom message")- time.sleep(0.05)- status_path = agent / "update-restarts" / "coordinator.json"- result = subprocess.run([str(candidate), "update", "--internal-update-restart-coordinator", "--daemon-socket",- str(endpoint), "--internal-update-restart-status", str(status_path)],- env=env, cwd=root, capture_output=True, text=True, timeout=180)- evidence.update(exit_code=result.returncode, stdout=result.stdout, stderr=result.stderr,- status=json.loads(status_path.read_text()))- stream, reader, hello = connect(endpoint)- reader.close()- stream.close()- evidence["successor"] = hello- successor_pid = hello["supervisorPid"]- assert result.returncode == 0, evidence- assert evidence["status"]["phase"] == "complete", evidence- assert successor_pid != old.pid- if options.with_session:- assert evidence["status"]["counts"]["restored"] == 1, evidence- assert evidence["status"]["counts"]["failed"] == 0, evidence- assert transcript.read_text().startswith(before), "old transcript must remain intact"- evidence["transcript_preserved"] = True- evidence["restored_sessions"] = request(endpoint, {"type": "list"})- restored = evidence["restored_sessions"]["sessions"]- assert len(restored) == 1, restored- assert restored[0]["sessionId"] == created["sessionId"], restored- assert restored[0]["sessionFile"] == str(transcript), restored- witness = "restored-session-bash-witness"- evidence["restored_bash"] = request(endpoint, {- "type": "execute_bash_and_wait", "activeSessionId": restored[0]["activeSessionId"],- "command": f"printf '%s' '{witness}'"})- bash = evidence["restored_bash"]- assert bash["output"] == witness and bash["exitCode"] == 0, bash- assert not bash["cancelled"] and not bash["truncated"], bash- deadline = time.monotonic() + 10- while True:- after = transcript.read_text()- rows = [json.loads(line) for line in after.splitlines()]- if any(row.get("message", {}).get("role") == "bashExecution"- and row["message"].get("output") == witness for row in rows):- assert after.startswith(before), "bash execution must preserve old transcript"- evidence["restored_bash_persisted"] = True- break- if time.monotonic() >= deadline:- raise RuntimeError("restored worker did not persist the bash result")- time.sleep(0.05)- evidence["success"] = True- finally:- evidence["old_log"] = (root / "old.log").read_text()- options.report.parent.mkdir(parents=True, exist_ok=True)- options.report.write_text(json.dumps(evidence, indent=2) + "\n")- try:- request(endpoint, {"type": "shutdown", "force": True})- except (OSError, ValueError, RuntimeError):- pass- if old.poll() is None:- old.terminate()- old.wait(timeout=30)- stop_fixture_processes(home)- print(json.dumps(evidence, indent=2))---if __name__ == "__main__":- main()diff --git a/scripts/release/test_legacy_tui_upgrade.py b/scripts/release/test_legacy_tui_upgrade.pydeleted file mode 100644index 352ab1bc55..0000000000--- a/scripts/release/test_legacy_tui_upgrade.py+++ /dev/null@@ -1,256 +0,0 @@-#!/usr/bin/env python3-"""Exercise a released TS /update in an isolated tmux session and local feed.--Uses no real provider credentials and sends no inference turns. The test checks-activation, daemon version replacement, session identity, and a responsive-restarted TUI. All sockets and state stay within a temporary directory.-"""-from __future__ import annotations--import argparse-import json-import os-from pathlib import Path-import shlex-import shutil-import socket-import subprocess-import tarfile-import tempfile-import time--from test_legacy_upgrade import (- archive_identity, digest, execute, isolated_environment, publish_archive, release_server,-)-import npm_bridge---def daemon_request(path: Path, command: dict | None = None) -> tuple[dict, dict | None]:- with socket.socket(socket.AF_UNIX) as client:- client.settimeout(3)- client.connect(str(path))- stream = client.makefile("r")- hello = json.loads(stream.readline())- if command is None:- return hello, None- client.sendall((json.dumps({"type": "command", "id": "migration-probe", "protocol": hello["protocol"], "command": command}) + "\n").encode())- while line := stream.readline():- response = json.loads(line)- if response.get("id") == "migration-probe":- return hello, response- raise RuntimeError("Daemon closed before replying")---def session_files(value) -> set[str]:- if isinstance(value, dict):- files = {value["sessionFile"]} if isinstance(value.get("sessionFile"), str) else set()- for child in value.values():- files.update(session_files(child))- return files- if isinstance(value, list):- return set().union(*(session_files(child) for child in value))- return set()---def wait_for(description: str, probe, timeout: float = 90):- deadline = time.monotonic() + timeout- last_error = None- while time.monotonic() < deadline:- try:- value = probe()- if value:- return value- except (OSError, ValueError, KeyError, RuntimeError) as error:- last_error = str(error)- time.sleep(0.1)- raise RuntimeError(f"Timed out waiting for {description}: {last_error}")---def exercise(root: Path, previous: Path, installer: Path | None, candidate: Path,- npm_prefix: Path | None = None, previous_checksums: Path | None = None,- fallback_tarball: Path | None = None) -> dict:- version, candidate_platform = archive_identity(candidate)- if npm_prefix:- if previous_checksums is None or fallback_tarball is None:- raise ValueError("Published npm checksums and fallback tarball are required")- expected = next((line.split()[0] for line in previous_checksums.read_text().splitlines()- if len(line.split()) == 2 and line.split()[1].lstrip("*") == previous.name), None)- if expected != digest(previous):- raise ValueError("Historical npm artifact checksum mismatch")- with tarfile.open(previous) as package:- metadata = json.load(package.extractfile("package/package.json"))- if metadata["name"] != "prime-agent" or metadata["bin"]["prime-agent"] != "dist/bundle/cli.js":- raise ValueError("Unexpected historical npm package entrypoint")- previous_version = metadata["version"]- old_entrypoint = package.extractfile("package/dist/bundle/cli.js").read()- platform = candidate_platform- else:- previous_version, platform = archive_identity(previous)- assert platform == candidate_platform- feed = root / "feed"- if not npm_prefix:- publish_archive(feed, previous)- publish_archive(feed, candidate)- manifest = {"version": version, "binaries": [{"platform": platform, "file": candidate.name, "sha256": digest(candidate)}]}- if npm_prefix:- bridge = npm_bridge.assemble(Path(__file__).resolve().parents[2], feed / "releases" / f"v{version}", version, "stable", fallback_tarball)- manifest.update(package="prime-agent", tarball=f"releases/v{version}/{bridge['tarball']}")- (feed / "latest.json").write_text(json.dumps(manifest))- daemon_socket = root / "daemon.sock"- tmux = ["tmux", "-S", str(root / "tmux.sock")]- evidence = {- "previous_version": previous_version, "candidate_version": version,- "previous_archive": {"path": str(previous), "sha256": digest(previous)},- "candidate_archive": {"path": str(candidate), "sha256": digest(candidate)},- "installation_method": "npm" if npm_prefix else "native",- "steps": [],- }- if installer:- evidence["installer"] = {"path": str(installer), "sha256": digest(installer)}- if npm_prefix:- evidence["npm_bridge_sha256"] = bridge["sha256"]- with release_server(feed) as base:- env = isolated_environment(root / "user", base, "standard")- env.update(TERM="xterm-256color", ANTHROPIC_API_KEY="fixture-not-a-real-key")- state = Path(env["PRIME_AGENT_CODING_AGENT_DIR"])- (state / "settings.json").write_text(json.dumps({"onboardingShown": True}))- if npm_prefix:- isolated_prefix = root / "npm prefix"- shutil.copytree(npm_prefix, isolated_prefix, symlinks=True)- entrypoint = isolated_prefix / "lib/node_modules/prime-agent/dist/bundle/cli.js"- assert entrypoint.read_bytes() == old_entrypoint, "Npm fixture entrypoint differs from published bytes"- env.update(npm_config_prefix=str(isolated_prefix), npm_config_cache=str(root / "npm-cache"),- npm_config_ignore_scripts="true", npm_config_audit="false", npm_config_fund="false",- npm_config_update_notifier="false", PRIME_AGENT_ALLOW_HTTP="1",- PRIME_AGENT_RUST_PREFIX=str(root / "rust prefix"),- PRIME_AGENT_DAEMON_SOCKET=str(daemon_socket))- env["PATH"] = str(isolated_prefix / "bin") + os.pathsep + env["PATH"]- public = isolated_prefix / "bin/prime-agent"- else:- public = Path(env["PRIME_AGENT_BIN_DIR"]) / "prime-agent"- evidence["steps"].append(execute(["sh", str(installer), previous_version], env))- # TS buffers unsaved drafts until an assistant message exists. Start- # from a valid saved transcript so the migration exercises restoration.- transcript = state / "sessions" / "migration.jsonl"- transcript.parent.mkdir(exist_ok=True)- stamp = "2026-10-09T00:00:00.000Z"- rows = [- {"type": "session", "version": 3, "id": "11111111-2222-4333-8444-555555555555", "timestamp": stamp, "cwd": env["HOME"]},- {"type": "message", "id": "seed-assistant", "parentId": None, "timestamp": stamp, "message": {- "role": "assistant", "content": [{"type": "text", "text": "durable migration sentinel"}],- "api": "anthropic-messages", "provider": "anthropic", "model": "claude-sonnet-4-5",- "usage": {"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "totalTokens": 0,- "cost": {"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0, "total": 0}},- "stopReason": "stop", "timestamp": 1791504000000}},- ]- transcript.write_text("".join(json.dumps(row) + "\n" for row in rows))- original_transcript = transcript.read_text()- command = [str(public), "--resume", str(transcript), "--daemon-socket", str(daemon_socket), "--provider", "anthropic", "--model", "claude-sonnet-4-5"]-- def tmux_run(*args):- return subprocess.run(tmux + list(args), env=env, capture_output=True, text=True, timeout=10)-- def screen():- captured = tmux_run("capture-pane", "-p", "-t", "migration")- if captured.returncode:- raise RuntimeError(captured.stderr)- return captured.stdout-- try:- started = tmux_run("new-session", "-d", "-s", "migration", "-x", "120", "-y", "36", "-c", env["HOME"], shlex.join(command))- if started.returncode:- raise RuntimeError(started.stderr)- tmux_run("pipe-pane", "-o", "-t", "migration", "cat > " + shlex.quote(str(root / "terminal.log"))).check_returncode()- wait_for("TS TUI ready", lambda: "durable migration sentinel" in screen() and "claude-sonnet" in screen())- before_hello, before_roster = daemon_request(daemon_socket, {"type": "list"})- evidence.update(before_hello=before_hello, before_roster=before_roster, before_screen=screen())- # The shipped slash-name completion consumes Enter while appending- # a space. End the name explicitly so this Enter submits the command.- tmux_run("send-keys", "-t", "migration", "-l", "/update ").check_returncode()- wait_for("update text rendered", lambda: "/update" in screen())- tmux_run("send-keys", "-t", "migration", "Enter").check_returncode()- wait_for("Rust daemon after /update", lambda: daemon_request(daemon_socket)[0].get("appVersion") == version, timeout=180)- wait_for("restarted Rust TUI", lambda: (- f"prime agent v{version}" in screen() or f"Prime Agent updated to v{version}" in screen()- ) and "durable migration sentinel" in screen())- wait_for("original session reattached", lambda: any(- session.get("sessionFile") == str(transcript) and session.get("attachedClients", 0) > 0- for session in daemon_request(daemon_socket, {"type": "list"})[1].get("data", {}).get("sessions", [])- ))- after_hello, after_roster = daemon_request(daemon_socket, {"type": "list"})- evidence.update(after_hello=after_hello, after_roster=after_roster, after_screen=screen())- evidence["steps"].append(execute([str(public), "--version"], env))- assert before_hello["appVersion"] == previous_version- assert after_hello.get("updateResume", {}).get("complete") is True, "Daemon did not finish update restoration"- terminal_output = (root / "terminal.log").read_text(errors="replace")- assert "could not coordinate the daemon restart" not in terminal_output.lower(), "Update coordinator could not launch"- assert "could not restart the daemon" not in terminal_output, "Update coordinator reported restart failure"- assert "daemon still runs the previous version" not in terminal_output, "Update coordinator reported a stale daemon"- assert before_hello["supervisorPid"] != after_hello["supervisorPid"]- previous_sessions = session_files(before_roster)- assert previous_sessions, f"TS daemon had no session files: {before_roster}"- assert previous_sessions <= session_files(after_roster), "Migrated daemon lost the original session"- assert transcript.read_text().startswith(original_transcript), "Saved transcript was rewritten"- evidence["transcript_preserved"] = True- assert evidence["steps"][-1]["stdout"].strip() == version- # Prove the new UI still accepts local input without provider calls.- tmux_run("send-keys", "-t", "migration", "-l", "migration-input-witness").check_returncode()- wait_for("responsive Rust input", lambda: "migration-input-witness" in screen())- evidence["responsive_screen"] = screen()- evidence["status"] = "passed"- except Exception as error:- evidence.update(status="failed", error=str(error))- try:- evidence["failure_screen"] = screen()- except RuntimeError as capture_error:- evidence["capture_error"] = str(capture_error)- try:- evidence["failure_hello"], evidence["failure_roster"] = daemon_request(daemon_socket, {"type": "list"})- except (OSError, ValueError, RuntimeError) as daemon_error:- evidence["daemon_error"] = str(daemon_error)- finally:- tmux_run("kill-server")- terminal_log = root / "terminal.log"- if terminal_log.exists():- evidence["terminal_stream"] = terminal_log.read_text(errors="replace")- try:- hello, _ = daemon_request(daemon_socket, {"type": "shutdown", "force": True})- pid = hello.get("supervisorPid")- if pid:- def stopped():- try:- os.kill(pid, 0)- return False- except ProcessLookupError:- return True- wait_for("isolated daemon cleanup", stopped, timeout=20)- except (OSError, ValueError, RuntimeError):- pass- return evidence---def main() -> int:- parser = argparse.ArgumentParser(description=__doc__)- parser.add_argument("--previous-archive", required=True, type=Path)- method = parser.add_mutually_exclusive_group(required=True)- method.add_argument("--installer-file", type=Path)- method.add_argument("--previous-npm-prefix", type=Path)- parser.add_argument("--previous-checksums", type=Path)- parser.add_argument("--fallback-tarball", type=Path)- parser.add_argument("--archive", required=True, type=Path)- parser.add_argument("--report", required=True, type=Path)- args = parser.parse_args()- with tempfile.TemporaryDirectory(prefix="ptui-", dir="/tmp") as temporary:- report = exercise(Path(temporary), args.previous_archive.resolve(),- args.installer_file.resolve() if args.installer_file else None,- args.archive.resolve(),- args.previous_npm_prefix.resolve() if args.previous_npm_prefix else None,- args.previous_checksums.resolve() if args.previous_checksums else None,- args.fallback_tarball.resolve() if args.fallback_tarball else None)- args.report.write_text(json.dumps(report, indent=2) + "\n")- print(json.dumps(report, indent=2))- return int(report["status"] != "passed")---if __name__ == "__main__":- raise SystemExit(main())