diff --git a/packages/flow/openadapt_flow/__main__.py b/packages/flow/openadapt_flow/__main__.py index f9a476b3b8..0b4addbcab 100644 --- a/packages/flow/openadapt_flow/__main__.py +++ b/packages/flow/openadapt_flow/__main__.py @@ -1130,6 +1130,18 @@ def _undo_run_target_problem(args: argparse.Namespace, workflow) -> Optional[str ) +def _print_terminal_receipt( + run_dir: Path, report, *, require_opt_in: bool = False +) -> None: + from openadapt_flow.receipt_record import receipt_after_run + + note = receipt_after_run( + run_dir, require_opt_in=require_opt_in, expected_report=report + ) + if note: + print(note, file=sys.stderr) + + def _finish_replay( run_dir: Path, report, @@ -1176,6 +1188,8 @@ def _finish_replay( print("\n" + "\n".join(rolled)) _maybe_report_break(run_dir, report) _maybe_report_run(run_dir, report, args, backend_kind=backend_kind) + if args is not None: + _print_terminal_receipt(run_dir, report) _maybe_attest_run(run_dir, report, args) if getattr(report, "execution_profile", None) in {"standard", "regulated"}: return 0 if outcome == "VERIFIED" else 1 @@ -5176,6 +5190,7 @@ def _resume_with(backend: "Backend") -> "RunReport": backend_kind=_report_backend_kind(backend_cfg.kind), ) _maybe_attest_run(run_dir, report, args) + _print_terminal_receipt(run_dir, report, require_opt_in=True) if getattr(report, "execution_profile", None) in {"standard", "regulated"}: return 0 if outcome == "VERIFIED" else 1 return 0 if report.success else 1 @@ -14276,12 +14291,12 @@ def main( args._record_check_proof_source = record_check_proof_source code = args.func(args) if getattr(args, "command", None) in ("run", "replay"): - # The run's receipt, and the older offline Seal for one release. - # Neither changes the run's exit code. + # Terminal handlers sign receipts. Keep the old Seal here for one release. from openadapt_flow.receipt_record import after_run_notes run_dir = getattr(args, "run_dir", None) - for note in after_run_notes(Path(run_dir) if run_dir else None): + folder = Path(run_dir) if run_dir else None + for note in after_run_notes(folder, include_receipt=False): print(note, file=sys.stderr) return code except (sealed_set.SealedSetError, at_rest.AtRestRefused) as exc: diff --git a/packages/flow/openadapt_flow/cli_worklist_pool.py b/packages/flow/openadapt_flow/cli_worklist_pool.py index d034549b8b..82a480aba2 100644 --- a/packages/flow/openadapt_flow/cli_worklist_pool.py +++ b/packages/flow/openadapt_flow/cli_worklist_pool.py @@ -280,7 +280,7 @@ def run_item(self, idx: int, row: dict[str, Any], item_dir: Path) -> ItemRun: prepare_ws_guard(self._page) self._page.goto(self.entry_url) report = self.run_item_on_page(self._page, idx, row, item_dir, self._pipeline) - return _item_run(report, self._pipeline) + return _item_run(report, self._pipeline, item_dir) def clean_after_halt(self, cleanup_dir: Path) -> Any: if self.clean is None: @@ -346,18 +346,23 @@ def run_item(self, idx: int, row: dict[str, Any], item_dir: Path) -> ItemRun: report = self.run_item_on_backend( self.backend, idx, row, item_dir, self._pipeline ) - return _item_run(report, self._pipeline) + return _item_run(report, self._pipeline, item_dir) def close(self) -> None: if self._pipeline is not None: self._pipeline.close() -def _item_run(report: Any, pipeline: Optional[ReadbackPipeline]) -> ItemRun: +def _item_run( + report: Any, pipeline: Optional[ReadbackPipeline], item_dir: Path +) -> ItemRun: state = item_state_from_report(report) detail = item_detail_from_report(report) handoff = pipeline.take() if pipeline is not None else None if handoff is None: + from openadapt_flow.receipt_record import receipt_after_run + + receipt_after_run(item_dir, require_opt_in=True, expected_report=report) if pipeline is not None and pipeline.inline_reason: detail["readback"] = f"inline ({pipeline.inline_reason})" return ItemRun(state=state, detail=detail) diff --git a/packages/flow/openadapt_flow/receipt_record.py b/packages/flow/openadapt_flow/receipt_record.py index fd889594fa..4f0a178bec 100644 --- a/packages/flow/openadapt_flow/receipt_record.py +++ b/packages/flow/openadapt_flow/receipt_record.py @@ -23,6 +23,8 @@ import json import os import re +import tempfile +from collections import Counter from dataclasses import replace from pathlib import Path from typing import TYPE_CHECKING, Any, Mapping, Optional, Sequence @@ -30,6 +32,7 @@ if TYPE_CHECKING: from openadapt_types.receipt import ReceiptVerification, RoleKey + from openadapt_flow.ir import RunReport from openadapt_flow.seal_keys import SealSigner RECEIPT_FILE = "receipt.json" @@ -51,50 +54,64 @@ def mode_enabled(env: Optional[Mapping[str, str]] = None) -> bool: return env.get(ENV_MODE, "on").strip().lower() not in ("0", "off", "false", "no") -def _count(value: Any) -> int: - if isinstance(value, bool): - return 0 - try: - return max(0, int(value)) - except (TypeError, ValueError): - return 0 - - -def _is_write(result: Mapping[str, Any]) -> bool: - return ( - result.get("effect_verified") is not None - or result.get("effect_approved_unverified") is True - or result.get("risk") == "irreversible" - or bool(result.get("effect_contract_hashes")) +def _line( + index: int, result: Mapping[str, Any], ledger: Mapping[str, Any] | None +) -> dict[str, Any]: + from openadapt_flow.check_level import CheckLevel, from_verification_tier + + evidence = result.get("effect_evidence") or [] + declared = Counter(result.get("effect_contract_hashes") or []) + ledger_effects = ledger["effects"] if ledger is not None else [] + # A declared effect can lack a bound hash when the run stopped before the + # reader ran. Keep the attempted write and withhold its verification. + ledger_matches = ( + ledger is None + or Counter(effect.get("contract_hash") for effect in ledger_effects) == declared ) - - -def _line(index: int, result: Mapping[str, Any]) -> dict[str, Any]: - effect = result.get("effect_verified") - if effect is True: - check, strength = "confirmed", "read_back" - elif effect is False: - check, strength = "refuted", "read_back" - else: - check = "not_checked" - strength = "same_screen" if result.get("postconditions_ok") is True else "none" + observed = Counter(item["effect_contract_hash"] for item in evidence) + check = "not_checked" + strength = "same_screen" if result.get("postconditions_ok") is True else "none" + # A negative aggregate flag covers both a contradiction and an unavailable + # reader. Only complete, contract-bound read evidence distinguishes them. + if declared and ledger_matches and declared == observed: + verdicts = {item["final_verdict"] for item in evidence} + levels = [ + from_verification_tier(item["verification_tier"]) + if type(item.get("verification_tier")) is int + else CheckLevel.UNCHECKED + for item in evidence + ] + if verdicts <= {"confirmed", "refuted"} and min(levels) > CheckLevel.UNCHECKED: + if "refuted" in verdicts: + check = "refuted" + elif ( + verdicts == {"confirmed"} + and result.get("effect_verified") is True + and all(item.get("observed_effect") == "present" for item in evidence) + and (ledger is None or ledger.get("status") == "confirmed") + ): + check = "confirmed" + if check != "not_checked": + strength = ( + "read_back" + if min(levels) >= CheckLevel.SYSTEM_OF_RECORD + else "same_screen" + ) not_checked: list[str] = [] - if effect is None: - not_checked.append( - "approved_unverified" - if result.get("effect_approved_unverified") is True - else "effect_not_declared" - ) - if effect is True and not result.get("effect_field_checks"): + if result.get("effect_approved_unverified") is True: + not_checked.append("approved_unverified") + if not declared and not ledger_effects: + not_checked.append("effect_not_declared") + if not result.get("effect_field_checks"): not_checked.append("field_values") if result.get("postconditions_ok") is None: not_checked.append("postconditions") return { "step": index, "target_kind": "api" if result.get("actuation") == "api" else "gui", - "operation": ( - "irreversible_write" if result.get("risk") == "irreversible" else "write" - ), + "operation": "irreversible_write" + if result.get("risk") == "irreversible" + else "write", "check": check, "strength": strength, "not_checked": not_checked, @@ -148,6 +165,50 @@ def _approval( return {"mode": mode, "approver_kind": kind, "commitments": {}}, values +def _write_lines(report: Mapping[str, Any], results: list[Any]) -> list[dict[str, Any]]: + from openadapt_types.receipt import MAX_LINES + + from openadapt_flow.ir import StepResult + from openadapt_flow.transaction import _attempt_state, _is_consequential_result + + # ChangeLedgerEntry.position counts executed (non-skipped) results. A + # position, unlike the step ID alone, also identifies repeated loop steps. + ledger = report.get("change_ledger", []) + if not isinstance(ledger, list) or not all( + isinstance(row, Mapping) + and type(row.get("position")) is int + and row["position"] > 0 + for row in ledger + ): + raise ReceiptRecordError("invalid_change_ledger", "invalid position") + rows = {row["position"]: row for row in ledger} + if len(rows) != len(ledger): + raise ReceiptRecordError("invalid_change_ledger", "duplicate position") + position = 0 + lines = [] + for index, result in enumerate(results): + if result.get("skipped") is True: + continue + position += 1 + row = rows.pop(position, None) + if row is not None and row["step_id"] != result.get("step_id"): + raise ReceiptRecordError("invalid_change_ledger", "step mismatch") + step = StepResult.model_validate(result) + if _attempt_state(step) == "not_actuated": + if row is not None: + raise ReceiptRecordError("invalid_change_ledger", "undelivered step") + continue + if row is not None or _is_consequential_result(step): + lines.append(_line(index, result, row)) + if rows: + raise ReceiptRecordError("invalid_change_ledger", "missing result") + if len(lines) > MAX_LINES: + raise ReceiptRecordError( + "too_many_writes", "the complete write list exceeds the receipt limit" + ) + return lines + + def build_statement( report: Mapping[str, Any], report_sha256: str, @@ -161,25 +222,23 @@ def build_statement( from openadapt_flow.public_seal import _checks, _hour, _int results = report.get("results") - results = ( - [x for x in results if isinstance(x, Mapping)] - if isinstance(results, list) - else [] - ) - every_line = [_line(i, x) for i, x in enumerate(results) if _is_write(x)] - lines = every_line[: r.MAX_LINES] + if not isinstance(results, list) or not all( + isinstance(x, Mapping) for x in results + ): + raise ReceiptRecordError("invalid_results", "expected the ordered run results") + try: + lines = _write_lines(report, results) + except (AttributeError, KeyError, TypeError, ValueError) as exc: + raise ReceiptRecordError("invalid_write_evidence") from exc tally = { k: sum(1 for line in lines if line["check"] == k) for k in ("confirmed", "refuted", "not_checked") } outcome, reason = r.receipt_outcome(report.get("execution_outcome")) - # Judge every write, not only the ones that fit: a refuted write past - # the line limit still refuses VERIFIED, and so does any write the - # receipt can't show. - if outcome == "VERIFIED" and any(x["check"] == "refuted" for x in every_line): - outcome, reason = "UNKNOWN", "refuted_write" - elif outcome == "VERIFIED" and len(every_line) > r.MAX_LINES: - outcome, reason = "UNKNOWN", "too_many_writes" + if outcome == "VERIFIED" and results and "change_ledger" not in report: + outcome, reason = "UNKNOWN", "incomplete_write_coverage" + if outcome == "VERIFIED" and (tally["refuted"] or tally["not_checked"]): + outcome, reason = "UNKNOWN", "unverified_write" bundle = report.get("bundle_content_digest") bundle = bundle if isinstance(bundle, str) and _SHA256.fullmatch(bundle) else None version = bundle or report_sha256 @@ -254,21 +313,18 @@ def build_statement( def _write(path: Path, payload: Mapping[str, Any], *, private: bool = False) -> None: - tmp = path.with_name(path.name + ".tmp") data = (json.dumps(payload, indent=2, sort_keys=True) + "\n").encode("utf-8") - from openadapt_flow.private_file import open_binary - - # A raw-byte descriptor (no Windows newline translation), every byte written. - fd = open_binary( - tmp, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600 if private else 0o644 - ) + fd, tmp = tempfile.mkstemp(prefix=f".{path.name}.", dir=path.parent) try: - view = memoryview(data) - while view: - view = view[os.write(fd, view) :] + with os.fdopen(fd, "wb") as handle: + handle.write(data) + handle.flush() + os.fsync(handle.fileno()) + if not private: + os.chmod(tmp, 0o644) + os.replace(tmp, path) finally: - os.close(fd) - os.replace(tmp, path) + Path(tmp).unlink(missing_ok=True) def write_receipt_record( @@ -277,70 +333,162 @@ def write_receipt_record( signer: Optional["SealSigner"] = None, home: Optional[Path] = None, flow_version: Optional[str] = None, + env: Optional[Mapping[str, str]] = None, + expected_report: Optional["RunReport"] = None, ) -> dict[str, Any]: """Write ``receipt.json`` and ``receipt.private.json`` for a finished run. Idempotent: an existing receipt over the same report bytes is kept. A receipt over different bytes is never silently replaced. """ + from openadapt_flow.sealed_maintenance import mutation_lock + + with mutation_lock(run_dir): + return _write_locked( + Path(run_dir), signer, home, flow_version, env, expected_report + ) + + +def _write_locked( + run_dir: Path, + signer: Optional["SealSigner"], + home: Optional[Path], + flow_version: Optional[str], + env: Optional[Mapping[str, str]], + expected_report: Optional["RunReport"], +) -> dict[str, Any]: from openadapt_types import receipt as r - from openadapt_flow.offline_seal import loads_strict, signer_for + from openadapt_flow import sealed_set + from openadapt_flow.offline_seal import signer_for + from openadapt_flow.runtime.durable.checkpoint import CheckpointStore from openadapt_flow.seal_keys import KeyUnavailable - run_dir = Path(run_dir) - report_path = run_dir / "report.json" + # Private openings need encrypted-set support before they can be persisted + # beside an encrypted report. A direct caller has the same boundary as CLI. + if sealed_set.is_sealed(run_dir): + raise ReceiptRecordError( + "encrypted_run", "private openings require encrypted storage" + ) + try: + pending = CheckpointStore(run_dir).read_pending() + except Exception as exc: + raise ReceiptRecordError( + "settlement_unknown", "cannot read durable run state" + ) from exc + if pending is not None and pending.status in {"pending", "approved", "continuing"}: + raise ReceiptRecordError( + "restartable_run", "the durable run can still continue" + ) + path = run_dir / "report.json" try: - raw = report_path.read_bytes() - report = loads_strict(raw.decode("utf-8")) - except (OSError, UnicodeDecodeError, ValueError) as exc: - raise ReceiptRecordError("report_unreadable", str(report_path)) from exc + raw = sealed_set.read_bytes(path) + report = r.loads_strict(raw) + except (OSError, ValueError) as exc: + raise ReceiptRecordError("report_unreadable", str(path)) from exc + if expected_report is not None and expected_report.report_bytes() != raw: + raise ReceiptRecordError( + "report_changed", "the saved report differs from this run" + ) if not isinstance(report, dict): raise ReceiptRecordError("report_unreadable", "report.json is not an object") + if report.get("transaction_outcome") == "SAVED_AWAITING_CHECK": + raise ReceiptRecordError("readback_pending") digest = hashlib.sha256(raw).hexdigest() + statement, openings = build_statement(report, digest, flow_version=flow_version) + chosen = signer or signer_for(home, env=env) + kid = r.key_id(chosen.public_raw()) + entry = chosen.registry_entry() + registry = [r.RoleKey(kid, entry["public_key"], "this_computer")] out = run_dir / RECEIPT_FILE + private = run_dir / PRIVATE_FILE + legacy = None if out.exists(): try: - existing = loads_strict(out.read_text(encoding="utf-8")) + existing = r.loads_strict(out.read_bytes()) + if r.is_receipt_envelope(existing): + checked = r.verify_receipt( + existing, registry, openings=r.loads_strict(private.read_bytes()) + ) + if ( + not checked.ok + or len(checked.signers) != 1 + or checked.statement is None + ): + raise ReceiptRecordError("existing_unverified", str(checked.reason)) + if {s["name"]: s["digest"] for s in checked.statement["subject"]} != { + s["name"]: s["digest"] for s in statement["subject"] + }: + raise ReceiptRecordError( + "already_signed", + "receipt subjects differ from the settled report", + ) + previous = checked.statement["predicate"] + expected = statement["predicate"] + # The verifier already bound every supplied opening to the + # signed commitments. New random salts cannot be compared. + for facts in (previous, expected): + facts["disclosure"].pop("commitments") + if facts.get("approval") is not None: + facts["approval"].pop("commitments") + expected_values = { + name: value["value"] for name, value in openings.items() + } + if previous != expected or checked.disclosed != expected_values: + raise ReceiptRecordError( + "already_signed", "receipt facts differ from the settled report" + ) + return existing except (OSError, ValueError) as exc: raise ReceiptRecordError("existing_unreadable", str(out)) from exc - if r.is_receipt_envelope(existing): - payload = loads_strict(base64.b64decode(existing["payload"])) - subjects = { - s["name"]: s["digest"]["sha256"] for s in payload.get("subject", []) - } - if subjects.get("report.json") == digest: - return existing - raise ReceiptRecordError( - "already_signed", "receipt.json covers different report bytes" - ) - # An older run-receipt/v2 summary in receipt.json: keep it, renamed. - if isinstance(existing, dict) and existing.get("schema_version", "").startswith( - "openadapt.run-receipt/" + if ( + not isinstance(existing, dict) + or existing.get("schema_version") != "openadapt.run-receipt/v2" ): - os.replace(out, run_dir / "run-summary.json") - else: + raise ReceiptRecordError("existing_unreadable", "unrecognized receipt file") + legacy = run_dir / "run-summary.json" + if legacy.exists() and legacy.read_bytes() != out.read_bytes(): raise ReceiptRecordError( - "existing_unreadable", "receipt.json is not a receipt" + "legacy_summary_conflict", "both summary files exist and differ" ) - if flow_version is None: - from openadapt_flow import __version__ as flow_version - statement, openings = build_statement(report, digest, flow_version=flow_version) - chosen = signer or signer_for(home) try: - kid = r.key_id(chosen.public_raw()) envelope = r.sign_statement(statement, [(kid, chosen.sign)]) except KeyUnavailable as exc: raise ReceiptRecordError(exc.code, str(exc)) from exc - _write(run_dir / PRIVATE_FILE, r.private_openings(envelope, openings), private=True) + if sealed_set.read_bytes(path) != raw: + raise ReceiptRecordError("report_changed", "report changed while signing") + if legacy is not None and not legacy.exists(): + # Preserve the original bytes; an error before envelope installation + # leaves the legacy file and any earlier summary readable. + os.link(out, legacy) + _write(private, r.private_openings(envelope, openings), private=True) _write(out, envelope) return envelope +def save_settled_report(run_dir: Path, report: "RunReport") -> "RunReport": + """Save the final read-back before issuing the pooled item's opted-in receipt.""" + report.save(run_dir) + receipt_after_run(run_dir, require_opt_in=True, expected_report=report) + return report + + def receipt_after_run( - run_dir: Optional[Path], env: Optional[Mapping[str, str]] = None + run_dir: Optional[Path], + env: Optional[Mapping[str, str]] = None, + *, + require_opt_in: bool = False, + expected_report: Optional["RunReport"] = None, ) -> Optional[str]: """CLI hook: write the run's receipt. Never raises, never changes the exit code.""" + env = os.environ if env is None else env + if require_opt_in and env.get(ENV_MODE, "").strip().lower() not in { + "1", + "on", + "true", + "yes", + }: + return None if run_dir is None or not mode_enabled(env): return None from openadapt_flow import sealed_set @@ -350,10 +498,11 @@ def receipt_after_run( if not (Path(run_dir) / "report.json").is_file(): return None try: - from openadapt_flow.offline_seal import seal_home, signer_for + from openadapt_flow.offline_seal import seal_home - home = seal_home(env) - write_receipt_record(Path(run_dir), signer=signer_for(home, env=env)) + write_receipt_record( + Path(run_dir), home=seal_home(env), env=env, expected_report=expected_report + ) except ImportError: return "receipt not written: openadapt-types is older than 0.25" except ReceiptRecordError as exc: @@ -363,15 +512,15 @@ def receipt_after_run( return f"receipt: {Path(run_dir) / RECEIPT_FILE}" -def after_run_notes(run_dir: Optional[Path]) -> list[str]: - """CLI hook after ``run`` and ``replay``: the older offline Seal, then the receipt. - - ``OPENADAPT_LOCAL_SEAL=off`` and ``OPENADAPT_RECEIPT=off`` turn each off. - Returns the status lines for stderr; never raises. - """ +def after_run_notes( + run_dir: Optional[Path], *, include_receipt: bool = True +) -> list[str]: + """Return the legacy Seal note and, when requested, the signed receipt note.""" from openadapt_flow.offline_seal import seal_after_run - notes = [seal_after_run(run_dir), receipt_after_run(run_dir)] + notes = [seal_after_run(run_dir)] + if include_receipt: + notes.append(receipt_after_run(run_dir)) return [note for note in notes if note] @@ -455,6 +604,7 @@ def verify_run_receipt( """Verify ``run_dir/receipt.json`` and check it covers the run's report bytes.""" from openadapt_types import receipt as r + from openadapt_flow import sealed_set from openadapt_flow.offline_seal import loads_strict run_dir = Path(run_dir) @@ -479,9 +629,12 @@ def verify_run_receipt( # against ``report.canonical``, never one against the other. for name in ("report.json", "report.pre-seal.json"): path = run_dir / name - if not path.is_file(): + if not sealed_set.is_file(path): continue - data = path.read_bytes() + try: + data = sealed_set.read_bytes(path) + except (OSError, sealed_set.SealedSetError): + return r._refuse("malformed", "the covered report is unreadable") try: canonical = r.report_canonical_sha256(loads_strict(data.decode("utf-8"))) except (UnicodeDecodeError, ValueError): @@ -497,7 +650,7 @@ def verify_run_receipt( detail="covers report.pre-seal.json; report.json changed after signing", ) return result - if not (run_dir / "report.json").is_file(): + if not sealed_set.is_file(run_dir / "report.json"): # A run folder's receipt is checked against its report: without the # signed bytes there is nothing to verify it over. return r._refuse("malformed", "the run folder has no report.json") diff --git a/packages/flow/openadapt_flow/runtime/replayer.py b/packages/flow/openadapt_flow/runtime/replayer.py index 4e7c5054da..be77597d6a 100644 --- a/packages/flow/openadapt_flow/runtime/replayer.py +++ b/packages/flow/openadapt_flow/runtime/replayer.py @@ -174,6 +174,7 @@ sha256_bytes, verify_fault_mutation_receipt, ) +from openadapt_flow.receipt_record import save_settled_report from openadapt_flow.run_gate import is_consequential from openadapt_flow.run_invocation import ( InvocationContext, @@ -3207,8 +3208,7 @@ def _settle_pipelined_readback( # to a person, and it never stays held open for the next item. if decide_approval: self._stamp_approval(report) - report.save(run_dir) - return report + return save_settled_report(run_dir, report) def recheck_deferred_readback( self, diff --git a/packages/flow/tests/test_readback_pipeline.py b/packages/flow/tests/test_readback_pipeline.py index b9aa923521..81839fde8c 100644 --- a/packages/flow/tests/test_readback_pipeline.py +++ b/packages/flow/tests/test_readback_pipeline.py @@ -161,11 +161,16 @@ def factory(url): pipeline.close() -def test_pending_report_is_not_saved_as_success(dirs) -> None: +def test_pending_report_is_not_saved_as_success(dirs, monkeypatch) -> None: """Until the read-back settles, report.json must not say success.""" import threading + from openadapt_flow.receipt_record import local_registry, verify_run_receipt + + monkeypatch.setenv("OPENADAPT_SEAL_HOME", str(dirs[1].parent / "signer")) + monkeypatch.setenv("OPENADAPT_RECEIPT", "on") + monkeypatch.delenv("OPENADAPT_SEAL_KEY", raising=False) gate = threading.Event() class SlowVerifier(RestRecordVerifier): @@ -189,10 +194,14 @@ def verify(self, *a, **k): ).run(looped, bundle_dir=bundle, run_dir=run_dir) saved = json.loads((run_dir / "report.json").read_text()) assert saved["success"] is False # pending + assert not (run_dir / "receipt.json").exists() gate.set() settled = pipeline.take().settled.result(timeout=30) assert settled is report and report.success is True assert json.loads((run_dir / "report.json").read_text())["success"] is True + checked = verify_run_receipt(run_dir, local_registry()) + assert checked.ok, checked.detail + assert checked.statement["predicate"]["lines"] finally: gate.set() stop() diff --git a/packages/types/openadapt_types/receipt_callback.py b/packages/types/openadapt_types/receipt_callback.py new file mode 100644 index 0000000000..a6fa3f7efa --- /dev/null +++ b/packages/types/openadapt_types/receipt_callback.py @@ -0,0 +1,51 @@ +"""Check a settled runner receipt before attaching it to a managed callback.""" + +from __future__ import annotations + +from typing import Any, Mapping + +from openadapt_types import receipt + + +def verified_receipt_metrics( + envelope_bytes: bytes, + *, + pinned_signer: Mapping[str, str], + report_jcs_sha256: str, + outcome: str, +) -> dict[str, Any]: + """Verify public bytes against the runner's pre-established public key. + + The caller supplies its final callback outcome in the receipt vocabulary + and the RFC 8785 digest computed from its actual report. Only the DSSE + envelope is eligible; private openings and public-card wrappers never + belong in a runner callback. + """ + if len(envelope_bytes) > 2 * receipt.MAX_PAYLOAD_BYTES: + raise ValueError("receipt exceeds the callback size limit") + if set(pinned_signer) != {"key_id", "public_key"}: + raise ValueError("the runner pin must contain its key ID and public key") + keys = receipt.parse_registry( + { + "schema": receipt.REGISTRY_SCHEMA, + "keys": [{**pinned_signer, "role": "this_computer"}], + } + ) + envelope = receipt.loads_strict(envelope_bytes) + if not isinstance(envelope, dict) or not receipt.is_receipt_envelope(envelope): + raise ValueError("expected a runner-signed receipt envelope") + checked = receipt.verify_receipt(envelope, keys) + if not checked.ok or checked.statement is None: + raise ValueError(f"receipt verification failed: {checked.reason}") + if len(checked.signers) != 1 or checked.signers[0].key_id != keys[0].key_id: + raise ValueError("expected one runner signature") + if checked.outcome != outcome: + raise ValueError("receipt outcome differs from the callback outcome") + if not receipt.report_subject_match( + checked.statement, canonical_sha256=report_jcs_sha256 + ): + raise ValueError("receipt does not cover the callback's canonical report") + return { + "receipt_record": envelope, + "receipt_record_signer": dict(pinned_signer), + } diff --git a/packages/types/pyproject.toml b/packages/types/pyproject.toml index 48ba7d1740..9cd420e743 100644 --- a/packages/types/pyproject.toml +++ b/packages/types/pyproject.toml @@ -44,6 +44,7 @@ Changelog = "https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/types/C [project.optional-dependencies] dev = [ + "cryptography>=50.0.0", "pytest>=7.0", "pytest-cov", ] diff --git a/packages/types/tests/test_receipt_callback.py b/packages/types/tests/test_receipt_callback.py new file mode 100644 index 0000000000..95418582ac --- /dev/null +++ b/packages/types/tests/test_receipt_callback.py @@ -0,0 +1,88 @@ +"""The managed sender accepts only a verified, public runner envelope.""" + +import hashlib +import json +import sys +from pathlib import Path + +import pytest +from openadapt_types import receipt as r +from openadapt_types.receipt_callback import verified_receipt_metrics + +VECTORS = Path(__file__).parent / "vectors" / "record-run-v1" + + +def _load(name): + return json.loads((VECTORS / f"{name}.json").read_bytes()) + + +def _pin(): + key = next( + item for item in _load("registry")["keys"] if item["role"] == "this_computer" + ) + return {field: key[field] for field in ("key_id", "public_key")} + + +@pytest.mark.parametrize( + "name", ["public-redaction", "tampered", "unknown-signer", "cloud-countersign"] +) +def test_private_managed_callback_refuses_an_unusable_public_document(name): + wire = json.dumps(_load(name)["document"]).encode() + with pytest.raises(ValueError): + verified_receipt_metrics( + wire, pinned_signer=_pin(), report_jcs_sha256="a" * 64, outcome="VERIFIED" + ) + + +def test_pin_is_limited_to_public_fields_and_private_openings_stay_local(): + vector = _load("valid") + for data, pin in ( + (json.dumps(vector["openings"]).encode(), _pin()), + (json.dumps(vector["document"]).encode(), {**_pin(), "status": "active"}), + (b"x" * (2 * r.MAX_PAYLOAD_BYTES + 1), _pin()), + (b'{"payload":0,"payload":1}', _pin()), + ): + with pytest.raises(ValueError): + verified_receipt_metrics( + data, pinned_signer=pin, report_jcs_sha256="a" * 64, outcome="VERIFIED" + ) + + +def test_callback_refuses_a_valid_record_when_the_verifier_is_unavailable(monkeypatch): + vector = _load("report-canonical") + monkeypatch.setitem(sys.modules, "cryptography.exceptions", None) + with pytest.raises(ValueError, match="verifier_unavailable"): + verified_receipt_metrics( + json.dumps(vector["document"]).encode(), + pinned_signer=_pin(), + report_jcs_sha256=r.report_canonical_sha256(vector["report"]), + outcome=vector["expected"]["outcome"], + ) + + +def test_callback_binds_only_the_jcs_digest_of_the_shared_report_vector(): + vector = _load("report-canonical") + wire = json.dumps(vector["document"]).encode() + digest = r.report_canonical_sha256(vector["report"]) + outcome = vector["expected"]["outcome"] + assert ( + verified_receipt_metrics( + wire, pinned_signer=_pin(), report_jcs_sha256=digest, outcome=outcome + )["receipt_record"] + == vector["document"] + ) + # This digest vector signs STOPPED but its sample report says VERIFIED. + report_outcome = r.receipt_outcome(vector["report"]["execution_outcome"])[0] + assert report_outcome != outcome + with pytest.raises(ValueError, match="outcome"): + verified_receipt_metrics( + wire, pinned_signer=_pin(), report_jcs_sha256=digest, outcome=report_outcome + ) + compact = hashlib.sha256(r.canonical_json(vector["report"]).encode()).hexdigest() + exact = hashlib.sha256(vector["report_file"].encode()).hexdigest() + assert len({digest, compact, exact}) == 3 + for other in (compact, exact): + with pytest.raises(ValueError, match="canonical report"): + verified_receipt_metrics( + wire, pinned_signer=_pin(), report_jcs_sha256=other, outcome=outcome + ) diff --git a/packages/types/uv.lock b/packages/types/uv.lock index 561d39d061..ba3d9515a9 100644 --- a/packages/types/uv.lock +++ b/packages/types/uv.lock @@ -1,6 +1,10 @@ version = 1 revision = 3 requires-python = ">=3.10" +resolution-markers = [ + "python_full_version >= '3.11'", + "python_full_version < '3.11'", +] [[package]] name = "annotated-types" @@ -11,6 +15,117 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, ] +[[package]] +name = "cffi" +version = "2.1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pycparser", version = "3.11", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11' and implementation_name != 'PyPy'" }, + { name = "pycparser", version = "3.12", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11' and implementation_name != 'PyPy'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9e/ef/008a1939e372c06329a3fce4279c02f328488f3526744906eeec3da7ad5f/cffi-2.1.1.tar.gz", hash = "sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be", size = 530807, upload-time = "2026-08-03T21:21:18.939Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b6/d2/2cde336b375f55c76ca670f0be3978cc048e31e24f3b4d7ce8473150a388/cffi-2.1.1-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:baed1e86cc735622097354b9d1281406caf42ff42a886d29faa8e8d1630333be", size = 183779, upload-time = "2026-08-03T21:19:15.602Z" }, + { url = "https://files.pythonhosted.org/packages/94/1a/4b2f7c92293ba05cbd4a9a1b28faaf0326272d9488e6354657571c48a7aa/cffi-2.1.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ca82be1a1d406ecfe1d25dc16cb33488e5a16bf4438c9fb590484ea29d92478b", size = 184178, upload-time = "2026-08-03T21:19:16.67Z" }, + { url = "https://files.pythonhosted.org/packages/17/0b/ba385d8ccedf926c3cd06e8e2f327027da5afe5f0eb30f1f7bc43ac55125/cffi-2.1.1-cp310-cp310-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:42e2f76b9455f5a9a844f770bf3e200ed3da0e15f5df3db9c31fe80b04b3d004", size = 211037, upload-time = "2026-08-03T21:19:17.705Z" }, + { url = "https://files.pythonhosted.org/packages/a3/b9/0f2e58b2cefa33255bff36935d42b13180fe559bba82596540eb404bde7d/cffi-2.1.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5a59cc1c4442bc3d5c703bf720b51138d0bfc173618807c9ee2490a7541dd3d9", size = 218652, upload-time = "2026-08-03T21:19:18.735Z" }, + { url = "https://files.pythonhosted.org/packages/37/15/180e0dab27b9312c7479003d14c9e547634b7dcb934e2cc4650e1b131a7a/cffi-2.1.1-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:9f8d177621de5cb38ee3e731eda45d421db093ec0739f46a5594babda7987a98", size = 205422, upload-time = "2026-08-03T21:19:19.96Z" }, + { url = "https://files.pythonhosted.org/packages/18/d4/03026f0c850cbbaa9030750490225b4a7f4d524ea4df72c3cc740a90f4ef/cffi-2.1.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:75f80557d1389eddbd0de2681f6a390a0c5338c31ddaa821381c203fc3fd50d9", size = 205444, upload-time = "2026-08-03T21:19:21.246Z" }, + { url = "https://files.pythonhosted.org/packages/75/77/60bebf6f818bec84210ac5b6979ce4eeadce6fbbaabc9c7ab23e506d1ce5/cffi-2.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:194cffa889098ced9976c3fc6340305e43f6303657d298da55366907c05c22d6", size = 218742, upload-time = "2026-08-03T21:19:22.523Z" }, + { url = "https://files.pythonhosted.org/packages/b0/ae/679bf47e73fd77b352171727f07de559a003f14de5d02b904a6ec1fa73ca/cffi-2.1.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5bb4e7ea95dcd6a014a6fef62e62467d67d8e582326443f3d68e71d6320a9fcf", size = 221054, upload-time = "2026-08-03T21:19:23.694Z" }, + { url = "https://files.pythonhosted.org/packages/09/b8/eefc0e06913b70aa153bf74c946094a18f58fd4aff11b7f372bfdfdca050/cffi-2.1.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3d22a20b1fb1632cc72c22f95f7b0d2961c3e1c235f245ba4c606c4771035659", size = 213489, upload-time = "2026-08-03T21:19:24.922Z" }, + { url = "https://files.pythonhosted.org/packages/6f/13/4e56852824a03cdf68523a35686f1c28eacd4bd30a7b0a78e682e6e6e1d3/cffi-2.1.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:1dea0e4d7d4f11f619fe8c1d76caf49e24405b4b5743c0e3be16a500ecd930c9", size = 220241, upload-time = "2026-08-03T21:19:26.214Z" }, + { url = "https://files.pythonhosted.org/packages/99/7f/040f9e163e4acac3ee3d85b02d00b2576e7ca980d8785f0a3a5f1a9bf7f5/cffi-2.1.1-cp310-cp310-win32.whl", hash = "sha256:7ce713ace7c0e4520535b42b77eaa742c16dab813978064913e5a3cf82973b41", size = 174578, upload-time = "2026-08-03T21:19:27.338Z" }, + { url = "https://files.pythonhosted.org/packages/ba/0b/644a2ec1a4eaba49c2939410bb1eb1d25b09d6d0582f5d2f95c537043725/cffi-2.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:a48d62ab9d6f4f98c983223a547af44be6ca3691074c31cecced6facd3ba2dc1", size = 185082, upload-time = "2026-08-03T21:19:28.409Z" }, + { url = "https://files.pythonhosted.org/packages/70/d2/16d99a0c4948febc0ebd133a13b2f688ff7f8cb04da971e1128872ce0c03/cffi-2.1.1-cp311-cp311-macosx_10_15_x86_64.whl", hash = "sha256:c8d2c9fd1f2d16f780d15127abb050d13d1a76c03a4bd87d7e4980e45e511e12", size = 183838, upload-time = "2026-08-03T21:19:29.637Z" }, + { url = "https://files.pythonhosted.org/packages/cd/95/31b535a9f0220ae9f357de4a08d57ce89cb417653c2fd9f075f50822a388/cffi-2.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:398aff33cee2767e3e781d2554c54bd0dff386bb437581e0d8011fde1a942ec1", size = 184168, upload-time = "2026-08-03T21:19:30.764Z" }, + { url = "https://files.pythonhosted.org/packages/ad/5a/4707a0dc1f203f5dde5a907b0d4e3c25d71120241048bd5bc6f1bb9d4e71/cffi-2.1.1-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:154852545011f779917b11c78db2358d095da62a9a172b78ad0a583ee5adc0d0", size = 211805, upload-time = "2026-08-03T21:19:31.867Z" }, + { url = "https://files.pythonhosted.org/packages/ad/66/c19feabb28485b6e0bbaaafa90837a1ef5d302e90f2178bd33f17a49879b/cffi-2.1.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3311ed60d36f83378794e1009ac6258bafbf81f7888b4caa7b35a521e3f95813", size = 218716, upload-time = "2026-08-03T21:19:32.896Z" }, + { url = "https://files.pythonhosted.org/packages/a7/92/500760486c8baab49a7a8a58ba7fc3355ec3974b454b8a09e528efde9e1d/cffi-2.1.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:6e192623c49c94421616a5778fba35cf0d5a8d000650c1967ef4448ee5cdd990", size = 205569, upload-time = "2026-08-03T21:19:34.142Z" }, + { url = "https://files.pythonhosted.org/packages/a5/a7/a67c733254d6e7373f7822f8082d8d6beade791e0cf12a7611f376fa61c7/cffi-2.1.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a6e721d4b0e45d5b65e87534470e67b18dcd092c83f68fba09f152b9cbc061af", size = 204907, upload-time = "2026-08-03T21:19:35.174Z" }, + { url = "https://files.pythonhosted.org/packages/f7/a4/4399daaf8f7dfee9d7c3327fdb0426ee041cc63edc358b93911ceb2bfc7a/cffi-2.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632", size = 217807, upload-time = "2026-08-03T21:19:36.286Z" }, + { url = "https://files.pythonhosted.org/packages/28/f7/dabe6da2466ecbd82dc62e7342dc6b1065dad990c06f00f0ede9ebf2a0ed/cffi-2.1.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7225e4514edb64eb6740324353e0da0711954fd8d7da4576755b1c6e09b697cd", size = 221252, upload-time = "2026-08-03T21:19:37.416Z" }, + { url = "https://files.pythonhosted.org/packages/ce/87/616202d8e51342c07d2534c510111c4cc37201775ce8f60802c9335d1edd/cffi-2.1.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:df913725b79db7bcf03448f36b7bf8815363417d5b58deecf9305e3e30f0f21a", size = 214214, upload-time = "2026-08-03T21:19:38.507Z" }, + { url = "https://files.pythonhosted.org/packages/b4/c6/ab025d75d2c26c19b087c0124e75ee31cb65032f4fe345d356d8c507ab97/cffi-2.1.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f5cfbc5fe74540d335175b656c725d74d90e3730c626d92575eea35029d9afaa", size = 219408, upload-time = "2026-08-03T21:19:39.809Z" }, + { url = "https://files.pythonhosted.org/packages/db/e2/7e8109f65445bdc673a7b54f02c677de462db75674220fd1335efc8eb598/cffi-2.1.1-cp311-cp311-win32.whl", hash = "sha256:f8ec5e643a9a937f64e1999eb9f75d072263751912dc5cd06d3c85f8f44be7c3", size = 174470, upload-time = "2026-08-03T21:19:41.246Z" }, + { url = "https://files.pythonhosted.org/packages/73/c0/77ba02423c2f7d7091143c45cd49e0e6575c4c1967394bb542bd923a9b74/cffi-2.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:42f6930c31dc7f50732c9ae793c2786c7b6b044195967bbdde40bb9be81c4cc0", size = 185096, upload-time = "2026-08-03T21:19:42.615Z" }, + { url = "https://files.pythonhosted.org/packages/7c/47/9f1f85f9672ceda4984dc6c4f8824e8558992a2972c3d3c81fb8eb28d4ba/cffi-2.1.1-cp311-cp311-win_arm64.whl", hash = "sha256:c7659f22557c5a0bc4855cd635f55edec690cc008a40768527762cb9fb263455", size = 179941, upload-time = "2026-08-03T21:19:43.747Z" }, + { url = "https://files.pythonhosted.org/packages/10/69/43965eccfdead3b9220015fd1320e117be8c6ed01a62ffab76eeb752f5d5/cffi-2.1.1-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0", size = 184821, upload-time = "2026-08-03T21:19:44.887Z" }, + { url = "https://files.pythonhosted.org/packages/54/7d/16e5a096677b5e313ca80cd5e5170efa3ea44624a82bb111925522da64b1/cffi-2.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf", size = 184719, upload-time = "2026-08-03T21:19:46.129Z" }, + { url = "https://files.pythonhosted.org/packages/56/e6/8941622732edec876dd17d0453dce07317ae96db34f2ec1436c9d3785986/cffi-2.1.1-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a", size = 214799, upload-time = "2026-08-03T21:19:47.218Z" }, + { url = "https://files.pythonhosted.org/packages/44/de/f98430906df1545ffde0d543dd124a7a439bc2cd32b36b9c53f805df7333/cffi-2.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890", size = 222389, upload-time = "2026-08-03T21:19:48.331Z" }, + { url = "https://files.pythonhosted.org/packages/6a/5b/717f1526b9957b34456313c31645c5b82b8fb5c3fe9e4752999be7128bfc/cffi-2.1.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50", size = 210249, upload-time = "2026-08-03T21:19:49.543Z" }, + { url = "https://files.pythonhosted.org/packages/64/b3/f8aa4f3e34986c7e4ec45072d1b1b9dd295b6b18007b45518d79726dd725/cffi-2.1.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e", size = 208775, upload-time = "2026-08-03T21:19:50.918Z" }, + { url = "https://files.pythonhosted.org/packages/b1/db/dceb9dd5b231e1da801793f8acc9f3c52a7e1afe40bb1aae37e02b0faad5/cffi-2.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf", size = 221822, upload-time = "2026-08-03T21:19:52.054Z" }, + { url = "https://files.pythonhosted.org/packages/a0/d2/6cd24ae3be000a634109c247d1475d62e5616d0dc78c82770942ec384248/cffi-2.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517", size = 225232, upload-time = "2026-08-03T21:19:53.109Z" }, + { url = "https://files.pythonhosted.org/packages/cb/52/3fa190537004dd7f0ab860a6dc7c0175b8667f68d1e618a46f5498d30250/cffi-2.1.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735", size = 223597, upload-time = "2026-08-03T21:19:54.515Z" }, + { url = "https://files.pythonhosted.org/packages/80/fb/0bb75b7039588c074b37ae99f40d9bfddf990ecb2fbc346ebccd2e56b9be/cffi-2.1.1-cp312-cp312-win32.whl", hash = "sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e", size = 175292, upload-time = "2026-08-03T21:19:55.566Z" }, + { url = "https://files.pythonhosted.org/packages/d9/79/615cc094e2fb508cade7de88d3b4f6c4ec2bab695c97bce9153dc65aadf5/cffi-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a", size = 185919, upload-time = "2026-08-03T21:19:56.89Z" }, + { url = "https://files.pythonhosted.org/packages/70/c6/d0ea84713fe46b243a436a18fcd47d639732747e21635c8a27191b06dc30/cffi-2.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80", size = 180093, upload-time = "2026-08-03T21:19:58.155Z" }, + { url = "https://files.pythonhosted.org/packages/9d/f4/035513d4117049066b4779dc3b7c0c0fdad175fa13731c9f4003f1cd1478/cffi-2.1.1-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e", size = 194248, upload-time = "2026-08-03T21:19:59.399Z" }, + { url = "https://files.pythonhosted.org/packages/76/af/2aeb4dbb5fc41a04161ae9ff1518de7cec08e164f44a8ce6a4cf7fd2cd1d/cffi-2.1.1-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c", size = 196908, upload-time = "2026-08-03T21:20:00.746Z" }, + { url = "https://files.pythonhosted.org/packages/a7/46/2e5fdde8555706dd98139a910ca11be02809f3f605ce956f655d0214e100/cffi-2.1.1-cp313-cp313-macosx_10_15_x86_64.whl", hash = "sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6", size = 184805, upload-time = "2026-08-03T21:20:02.02Z" }, + { url = "https://files.pythonhosted.org/packages/55/41/4c7042f317b9217502988f0873af87e16ad606dc20f84e546e3e6ce9764c/cffi-2.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971", size = 184764, upload-time = "2026-08-03T21:20:03.141Z" }, + { url = "https://files.pythonhosted.org/packages/43/1f/1c3d90d91811c8f86ced9ed637956c54bfe5b79ca98fe976d7f8c8979f6b/cffi-2.1.1-cp313-cp313-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:6a8dddef476fab96d066d578fc88526767b836ab5ab21754e1d5bf3879c31c7c", size = 214722, upload-time = "2026-08-03T21:20:04.377Z" }, + { url = "https://files.pythonhosted.org/packages/37/6f/3b5ce4c3b2192d250f04908f2bfd91ef34552ec8f7716a5d4abdb8d67bb2/cffi-2.1.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f16c709686a78c727bbbf059f92b0bf41c6fc60deec706d2dc19f529175a6125", size = 222369, upload-time = "2026-08-03T21:20:05.544Z" }, + { url = "https://files.pythonhosted.org/packages/02/10/4b3c75dde3d9663c9e02ba05c2668b954f671d4bbe346413ca8c696b295a/cffi-2.1.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:fcd22650c908d7b7da162bbfaab594a1227a15d1643a98c68b122ac642fa2264", size = 210175, upload-time = "2026-08-03T21:20:06.75Z" }, + { url = "https://files.pythonhosted.org/packages/df/62/14f74b9543e605d17701dc797b815958b8bb70b7624ce1b832ddad48ed6c/cffi-2.1.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:aa9511c62d14da7aacc9b4bf51f3f697a621e83b2d6919008243c3aad168eea3", size = 208670, upload-time = "2026-08-03T21:20:08.04Z" }, + { url = "https://files.pythonhosted.org/packages/95/95/86342356ff5953b3fb06f7ef7c5bee212d45e770abc7218d451b9148313c/cffi-2.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a931079504ecc49efed7744c476a5c343a92fabf66dec2db95edb1b2fdc770e2", size = 221824, upload-time = "2026-08-03T21:20:09.274Z" }, + { url = "https://files.pythonhosted.org/packages/eb/ff/7b3429ff53aafe931ed8a5fc69f481bbef7ba6de87ddcbb63d08f483f613/cffi-2.1.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a2d7755bef5a12ed488f4ef1f1b69ee9191d7396083b755a5d2295f6edb4768b", size = 225148, upload-time = "2026-08-03T21:20:10.7Z" }, + { url = "https://files.pythonhosted.org/packages/34/34/a95870b9221e09cf4f2ce3178b1a210abdfe63a1bd357da940418d7b8d15/cffi-2.1.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e0bcb7e0f677f543555d2adff3bf19c05f66cdb4796e5ff602442ab2fe3c4ef7", size = 223564, upload-time = "2026-08-03T21:20:12.165Z" }, + { url = "https://files.pythonhosted.org/packages/70/ea/839b50531021a647fb5e929f72cf97bc1ff702b5472166164b5b6e76b851/cffi-2.1.1-cp313-cp313-win32.whl", hash = "sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac", size = 175263, upload-time = "2026-08-03T21:20:13.559Z" }, + { url = "https://files.pythonhosted.org/packages/60/a6/8b149b2c3f2e11aaa1618ef64500b45f50f22c57a977a4dff1aff1f91042/cffi-2.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d", size = 185688, upload-time = "2026-08-03T21:20:14.69Z" }, + { url = "https://files.pythonhosted.org/packages/01/9a/11f687cb39d6a3504060d5242f04f48c735afb4d3d533958a20594890cb2/cffi-2.1.1-cp313-cp313-win_arm64.whl", hash = "sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973", size = 180078, upload-time = "2026-08-03T21:20:15.917Z" }, + { url = "https://files.pythonhosted.org/packages/d3/7b/d6bbf82b8b96e7391438898c42f5bd96dd02030fd5b64937d248220003e2/cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c", size = 194064, upload-time = "2026-08-03T21:20:17.148Z" }, + { url = "https://files.pythonhosted.org/packages/94/e6/bcc91b283be94735e268487a054004f0aa19947b6348fa367db53230abc8/cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb", size = 196720, upload-time = "2026-08-03T21:20:18.268Z" }, + { url = "https://files.pythonhosted.org/packages/d9/99/c4b0c17cacdc9c3b8f280026286a9826d6a208c0f047591a3c3ce99b91fd/cffi-2.1.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54", size = 184964, upload-time = "2026-08-03T21:20:19.708Z" }, + { url = "https://files.pythonhosted.org/packages/b3/a9/9db617d05d7367c1ad0ab00b3aa6e6f9281edd689b4ee9ea0e5a84e89c97/cffi-2.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72", size = 184962, upload-time = "2026-08-03T21:20:20.833Z" }, + { url = "https://files.pythonhosted.org/packages/67/b8/b42132ca113dc567d37684437b46ca1dafc885902b02a110a02d5b511857/cffi-2.1.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1", size = 222328, upload-time = "2026-08-03T21:20:22.118Z" }, + { url = "https://files.pythonhosted.org/packages/80/10/c5c0cbf0a657aecf59ef511409734230bf556f05a0d6c9eed7aa5c0a0166/cffi-2.1.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062", size = 209985, upload-time = "2026-08-03T21:20:23.401Z" }, + { url = "https://files.pythonhosted.org/packages/d5/6c/bfa0b87b03b9238148beca990292843c9396ba069b54496596594173de7b/cffi-2.1.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03", size = 208530, upload-time = "2026-08-03T21:20:24.628Z" }, + { url = "https://files.pythonhosted.org/packages/e9/02/4e7d553a7ac4b4238b38b3c1b80d486e9d4436f8d2acbf87a0997fe3f402/cffi-2.1.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96", size = 221525, upload-time = "2026-08-03T21:20:25.758Z" }, + { url = "https://files.pythonhosted.org/packages/82/1d/a4aaf9babd75acb4d5f223bff71533bee748dd770a382619a798960ee9ba/cffi-2.1.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527", size = 225053, upload-time = "2026-08-03T21:20:26.985Z" }, + { url = "https://files.pythonhosted.org/packages/81/10/5dc0e7bdd18e22107054288283380fc97a06ae3f1656a106908d666a3c88/cffi-2.1.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13", size = 223213, upload-time = "2026-08-03T21:20:28.277Z" }, + { url = "https://files.pythonhosted.org/packages/0b/e9/d0061c364cde06ee43168a0d076ac1da512cbc380d44767b844ba34fe2b6/cffi-2.1.1-cp314-cp314-win32.whl", hash = "sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c", size = 177682, upload-time = "2026-08-03T21:20:44.288Z" }, + { url = "https://files.pythonhosted.org/packages/a7/06/1c3e01e3ba14c39f6d10bfbac52753b7e22259e38088e5cfe1d704918690/cffi-2.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48", size = 187949, upload-time = "2026-08-03T21:20:45.623Z" }, + { url = "https://files.pythonhosted.org/packages/87/5b/da4e39efe18eeb89cf580ea9cfc66b6a7c3eadb808fc0cc1d3a295cb5a5d/cffi-2.1.1-cp314-cp314-win_arm64.whl", hash = "sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836", size = 182947, upload-time = "2026-08-03T21:20:46.955Z" }, + { url = "https://files.pythonhosted.org/packages/23/59/40338bf421c5accea1d45158170c87006ef1cd371b05c077e76476949728/cffi-2.1.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3", size = 188504, upload-time = "2026-08-03T21:20:29.495Z" }, + { url = "https://files.pythonhosted.org/packages/7d/47/5ecf1023850036e674c77ec4de86182d309ae344e39e7cba984b7df5d647/cffi-2.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2", size = 188259, upload-time = "2026-08-03T21:20:31.291Z" }, + { url = "https://files.pythonhosted.org/packages/2a/9c/92934c3bea9f785b23eba304538c0b4d37a2a96d2431eb3a1bc87a11aa19/cffi-2.1.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94", size = 223864, upload-time = "2026-08-03T21:20:32.571Z" }, + { url = "https://files.pythonhosted.org/packages/4d/45/ba4c93527bc38616a8bd36488acb69a2212d60486794f0c1f318949bbb76/cffi-2.1.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc", size = 211538, upload-time = "2026-08-03T21:20:33.808Z" }, + { url = "https://files.pythonhosted.org/packages/80/e9/b6ef565e452acb932fb0cb5443f44a78efbd1233e566f02b5a83855e9115/cffi-2.1.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29", size = 210688, upload-time = "2026-08-03T21:20:34.974Z" }, + { url = "https://files.pythonhosted.org/packages/9a/95/eff5f0cee78d2eabc7eebffec40d3fc1876b5f3c95582e018bb4b99601f2/cffi-2.1.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676", size = 223803, upload-time = "2026-08-03T21:20:36.564Z" }, + { url = "https://files.pythonhosted.org/packages/fa/01/579d39fb8bef00a335a23d83757b44feb24cd6345a2c451b64cb67b9c362/cffi-2.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e", size = 226763, upload-time = "2026-08-03T21:20:37.816Z" }, + { url = "https://files.pythonhosted.org/packages/8d/b0/0b44f47c60b01b57b6e2bbd92343f13a85a1d93bc46ccf6e47e244acd99c/cffi-2.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f", size = 225688, upload-time = "2026-08-03T21:20:38.959Z" }, + { url = "https://files.pythonhosted.org/packages/eb/d2/3b7176cb570a1d3e27faf67b72f591af508036e0d8b2be2ef9af9e8c84bb/cffi-2.1.1-cp314-cp314t-win32.whl", hash = "sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4", size = 182868, upload-time = "2026-08-03T21:20:40.388Z" }, + { url = "https://files.pythonhosted.org/packages/56/78/31f00c1bcd97c9bbf55f1bfdf5bc809a5de8887473e90bb9960dca825e80/cffi-2.1.1-cp314-cp314t-win_amd64.whl", hash = "sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e", size = 194104, upload-time = "2026-08-03T21:20:41.725Z" }, + { url = "https://files.pythonhosted.org/packages/7b/1b/58496f2ed0a35de575250c02a43ab3cc2c04d494a88fed31c1cabc0fd176/cffi-2.1.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5", size = 186402, upload-time = "2026-08-03T21:20:43.042Z" }, + { url = "https://files.pythonhosted.org/packages/c1/8f/9ebe220eab48a093d1a5a5e339ab0dc7316eef3bb04d63c42f0251b61f50/cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphoneos.whl", hash = "sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d", size = 194043, upload-time = "2026-08-03T21:20:48.179Z" }, + { url = "https://files.pythonhosted.org/packages/ff/69/844bad3ece306c4782c2ecb93597035b6690d48704b803914c199da1e8b3/cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b", size = 196737, upload-time = "2026-08-03T21:20:49.457Z" }, + { url = "https://files.pythonhosted.org/packages/1b/8a/af668013284634733f02d683458a0728739c7d6ddb5e14cb0c20832266fe/cffi-2.1.1-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4", size = 184933, upload-time = "2026-08-03T21:20:50.639Z" }, + { url = "https://files.pythonhosted.org/packages/0c/75/2f5207ff6d1a613133b23a5203cc0c2a628313b5eb3974d7956ae3c57950/cffi-2.1.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8", size = 185002, upload-time = "2026-08-03T21:20:52.173Z" }, + { url = "https://files.pythonhosted.org/packages/e2/31/9e1313b0a6e30e91b3b3d3fff51ae99c857c07738e3afcce1f7334e1b7ab/cffi-2.1.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6", size = 222271, upload-time = "2026-08-03T21:20:53.462Z" }, + { url = "https://files.pythonhosted.org/packages/50/e3/f6234a833e6e08c7007003074723c406559eecf9b48dfc97471e5a8eb7a0/cffi-2.1.1-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80", size = 209919, upload-time = "2026-08-03T21:20:54.783Z" }, + { url = "https://files.pythonhosted.org/packages/0d/fc/5f74e293fced6edb51af3a46c4ccf6c23c9943774ecb375ddbd522c76add/cffi-2.1.1-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779", size = 208529, upload-time = "2026-08-03T21:20:56.066Z" }, + { url = "https://files.pythonhosted.org/packages/44/16/29e6d01b388bef055ecd6ca8244b3f4d336bd09e92d5d892187b9601084e/cffi-2.1.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399", size = 221630, upload-time = "2026-08-03T21:20:57.336Z" }, + { url = "https://files.pythonhosted.org/packages/a4/18/fa7f1f6857d5eb88a4ca99ffcbfb7c387a287ccc154c64a73e86314745d7/cffi-2.1.1-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688", size = 225134, upload-time = "2026-08-03T21:20:58.675Z" }, + { url = "https://files.pythonhosted.org/packages/e0/9f/e8e3dfa04a1b4c241f8c91faacad872b4d4efd051d49764ad4e2fd4b9fea/cffi-2.1.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7", size = 223197, upload-time = "2026-08-03T21:20:59.968Z" }, + { url = "https://files.pythonhosted.org/packages/f8/7e/8debeb04f1ab9fe2a6963964cd6f1aaf7192627b83926586a6a4e089c9fa/cffi-2.1.1-cp315-cp315-win32.whl", hash = "sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac", size = 177683, upload-time = "2026-08-03T21:21:14.901Z" }, + { url = "https://files.pythonhosted.org/packages/e0/31/5158704cc474ab65c1647932e88be78dc0873f47130e253be38bcaf13d01/cffi-2.1.1-cp315-cp315-win_amd64.whl", hash = "sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960", size = 187897, upload-time = "2026-08-03T21:21:16.108Z" }, + { url = "https://files.pythonhosted.org/packages/cc/4b/b3a2da8570c704ffc0f9762cdc3ec0f02c8573798e0b5cf7f11c82bbb70f/cffi-2.1.1-cp315-cp315-win_arm64.whl", hash = "sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1", size = 182935, upload-time = "2026-08-03T21:21:17.271Z" }, + { url = "https://files.pythonhosted.org/packages/d0/ef/5443574510a1207e6f6bc38ba6e1f1de36cb48fef07b2728bb896a21f430/cffi-2.1.1-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc", size = 188464, upload-time = "2026-08-03T21:21:01.163Z" }, + { url = "https://files.pythonhosted.org/packages/7e/ae/a56fa8c4686ad50e148fcbc8d3ae0d03915ff5c30d795058988c24118cef/cffi-2.1.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab", size = 188262, upload-time = "2026-08-03T21:21:02.382Z" }, + { url = "https://files.pythonhosted.org/packages/53/b2/6187f46f2912276a3ae284076109cc5c8680482f11f766ccf26db4a86427/cffi-2.1.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e", size = 223779, upload-time = "2026-08-03T21:21:03.553Z" }, + { url = "https://files.pythonhosted.org/packages/8a/f6/c3ad28bd19f77047a03084424fbd4cbe997303267c14423737324be0385d/cffi-2.1.1-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358", size = 211520, upload-time = "2026-08-03T21:21:04.863Z" }, + { url = "https://files.pythonhosted.org/packages/a0/cd/ccac9013a5bd9fd764de118674ab9c805b5ca10c19270d90ee273f8b2240/cffi-2.1.1-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231", size = 210673, upload-time = "2026-08-03T21:21:06.223Z" }, + { url = "https://files.pythonhosted.org/packages/52/86/2976131c639aead931c5bee5aba67e4b09fbeb8018b6f282f70803f923a7/cffi-2.1.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6", size = 223835, upload-time = "2026-08-03T21:21:07.539Z" }, + { url = "https://files.pythonhosted.org/packages/ac/0c/33a7aeab2f9c76918c52e084beb39c570db3588133412929e8ec06fab90b/cffi-2.1.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94", size = 226705, upload-time = "2026-08-03T21:21:08.774Z" }, + { url = "https://files.pythonhosted.org/packages/e3/26/2cde30fdde421130bfc18f70395731a6e6b2053c6a1978a5258ff04e72fa/cffi-2.1.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5", size = 225539, upload-time = "2026-08-03T21:21:09.911Z" }, + { url = "https://files.pythonhosted.org/packages/6d/cd/a361394c94b2129d604bb846f624a8e88255a3ee33129c434a00d715e64f/cffi-2.1.1-cp315-cp315t-win32.whl", hash = "sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66", size = 182707, upload-time = "2026-08-03T21:21:11.226Z" }, + { url = "https://files.pythonhosted.org/packages/9b/b5/ba2b299993c26577d529b6ae29841f9e15b9fcf004d65f423f4fcf94ade9/cffi-2.1.1-cp315-cp315t-win_amd64.whl", hash = "sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3", size = 193772, upload-time = "2026-08-03T21:21:12.39Z" }, + { url = "https://files.pythonhosted.org/packages/aa/29/35e016098c814cd93de9cd320c66b5bfba14dc6ecedd3cb518fa7c408c69/cffi-2.1.1-cp315-cp315t-win_arm64.whl", hash = "sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692", size = 186360, upload-time = "2026-08-03T21:21:13.636Z" }, +] + [[package]] name = "colorama" version = "0.4.6" @@ -138,6 +253,76 @@ toml = [ { name = "tomli", marker = "python_full_version <= '3.11'" }, ] +[[package]] +name = "cryptography" +version = "50.0.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9d/af/182eb91b0df3fe75c4d9f26fe70684569566745f6ba7e5c9c73a862c5252/cryptography-50.0.2.tar.gz", hash = "sha256:7b46165bb56eb4704e2eaaf86f3c940d19154535d9b0ca7d6d590b04060e00d5", size = 880623, upload-time = "2026-09-30T15:30:04.884Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e5/56/d194340cc4a57535e82e1bee9e89667ac4b7c13b5d3f59686deae3094dd5/cryptography-50.0.2-cp311-abi3-macosx_11_0_arm64.whl", hash = "sha256:fa8f5efb344d6908a1ce62f4a24e2e5780f825d6f53f5f50ec5ffacac72936cb", size = 3914904, upload-time = "2026-09-30T14:43:44.339Z" }, + { url = "https://files.pythonhosted.org/packages/d9/69/c9bd862c3bf43d6399c433caf002df16e2dffd4be49bdf515cda38038711/cryptography-50.0.2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:79def8d059362e7831389ed3be0ecdf58a89386e1271e35dd9f5af84e81bffd0", size = 4731146, upload-time = "2026-09-30T14:43:47.113Z" }, + { url = "https://files.pythonhosted.org/packages/21/69/64cef1f702bf6657e0cc186ed1a2891d50d29fb41586b254e1c07adea261/cryptography-50.0.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:630ebfea3bf689d075f82316324ff7433dc447fe6bc1bfc76524b74b4a9567d2", size = 4719841, upload-time = "2026-09-30T14:43:49.01Z" }, + { url = "https://files.pythonhosted.org/packages/38/6b/61a3f8d8c5e1e49a6cddccafc4015cc1c0021360ab0acb4080e7a423644a/cryptography-50.0.2-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:f9f6143a8c75945eb960d9eb98905a441394abfa24afaae239d514ffb2586480", size = 4738340, upload-time = "2026-09-30T14:43:50.932Z" }, + { url = "https://files.pythonhosted.org/packages/7b/2e/7212ca32fd43dc91f2f41db20160b268098874b4c9a0e7be94d6835f5b2e/cryptography-50.0.2-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:a582ab2ae1d34f67112cadc86702774c9ea4374df6bca6afe672817203c99134", size = 5367029, upload-time = "2026-09-30T14:43:52.911Z" }, + { url = "https://files.pythonhosted.org/packages/1a/f1/b474e930c4d910328780e3940da76f5aa5cbc48ce1fc14e44d239d9ea9db/cryptography-50.0.2-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:4061c0079120205fb760c58acab6443e217307dcf05e3702cf970e0689972856", size = 4753050, upload-time = "2026-09-30T14:43:55.272Z" }, + { url = "https://files.pythonhosted.org/packages/7c/52/9af10e80ac16b0fcc2123f9cbd5e7afbd0fd5075bb7a607c592258a39cda/cryptography-50.0.2-cp311-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:ac9ed99d81760c62fe89d5f0815cdfa1ba9a35141cf30f1c2d044f04b4803d2e", size = 4376724, upload-time = "2026-09-30T14:43:57.24Z" }, + { url = "https://files.pythonhosted.org/packages/71/37/6202e488cc1eb625ea110c292c6bda92823176e023f427d8d5660ce8d632/cryptography-50.0.2-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:87e9ce85beb6b328ba370cc6e6aea483c92617b4c95b1d33a49297eb662bfb04", size = 4737859, upload-time = "2026-09-30T14:43:59.541Z" }, + { url = "https://files.pythonhosted.org/packages/8f/30/e86d7d518489b0ae2497091a35287abcb1a2ce4037837a34afbe9b1d6964/cryptography-50.0.2-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:f265528741e048bce55c3463ed721fb0aa45a5888d8add8cfeccb3035451bbdc", size = 5324103, upload-time = "2026-09-30T14:44:01.901Z" }, + { url = "https://files.pythonhosted.org/packages/d3/69/2c833a049475e0a3444e94c7d0aca0aa51d166374a449b09e92ac98138de/cryptography-50.0.2-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:9dab55f57c74c3cad24c323bacbbd04be4705ba6eb0d92e920b1fc4837ed5079", size = 4752576, upload-time = "2026-09-30T14:44:04.545Z" }, + { url = "https://files.pythonhosted.org/packages/6c/5d/906970b83bbfc1f5bbfb677a143c181f2801f23b6a7204a3b47c42c97e65/cryptography-50.0.2-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:25784ce8b9621c90c643efb9e1e2162ab3b0224cae446ad5e70e7fcb1ce18b51", size = 4870819, upload-time = "2026-09-30T14:44:06.884Z" }, + { url = "https://files.pythonhosted.org/packages/68/e3/f2298d3bb55e0c4a91841ec4d01b3f020ba8c5fbf15ccdcc6dcf03f97025/cryptography-50.0.2-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:85d0d9a31b9098e98534226d5686b47264b95e62ce459dc2e62fdfc809f9fe93", size = 5030152, upload-time = "2026-09-30T14:44:09.443Z" }, + { url = "https://files.pythonhosted.org/packages/9a/4f/adfc442765721292fff86d314ce385d3249d22db42295c0dd057727b60f3/cryptography-50.0.2-cp311-abi3-win_amd64.whl", hash = "sha256:7afa5a6602a9f29af1f3a2965f831bae7c9d5d597b7cbb716d41ab3b7d89879c", size = 3824692, upload-time = "2026-09-30T14:44:11.671Z" }, + { url = "https://files.pythonhosted.org/packages/ce/cb/52eb3770c0d0be2702a98c6e96065ddc0a2877cf0845aa9c23397c142cd4/cryptography-50.0.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f785f6161f202ab04d8ca194158968798e480ca058943907972da5f12e2881e8", size = 3892731, upload-time = "2026-09-30T14:44:13.485Z" }, + { url = "https://files.pythonhosted.org/packages/19/8e/aa1fc533d4546b127b45de8aa024eb5933d23eff9debfe25931e56861095/cryptography-50.0.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:0ecbc5652bdb6fc9eaf89a7d196e20941adfe812f43bc4ca05d9150496821047", size = 4710431, upload-time = "2026-09-30T14:44:15.427Z" }, + { url = "https://files.pythonhosted.org/packages/6a/64/72bc3f75176e7e406b748a3e3830432b8c51297b38368713df04dc04898a/cryptography-50.0.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ab50ee449bf968271e820086f10a33d101dd060370abc10bcd22279be2656539", size = 4694824, upload-time = "2026-09-30T14:44:17.69Z" }, + { url = "https://files.pythonhosted.org/packages/4e/c6/62c77550edfa5ca3f14bf44a1e6739b9fa09d6e998a11d97ed8213bccc98/cryptography-50.0.2-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:a9f7355e6fab51f6c369b86fb7571cffa05edee2c2121e0380a37fb9ac1cd5c1", size = 4716967, upload-time = "2026-09-30T14:44:19.661Z" }, + { url = "https://files.pythonhosted.org/packages/f4/37/cce70f150c432914460157a6ecc161752e053aa5ec0ef3b3f7dc6e31039a/cryptography-50.0.2-cp314-cp314t-manylinux_2_28_ppc64le.whl", hash = "sha256:94e5e9f108ee10471288214d3d233fbfbb492840a8457eb85178d643ddeb32c7", size = 5328676, upload-time = "2026-09-30T14:44:21.744Z" }, + { url = "https://files.pythonhosted.org/packages/aa/9a/6f2f0304d634ceafdeaf23e84537336664ac419b5d07611675c2ad3f6b7a/cryptography-50.0.2-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:241449bf940a5d27309bd317e6f9a2af6932113818bb2b8f5c59ddc7ef16da18", size = 4727698, upload-time = "2026-09-30T14:44:24.178Z" }, + { url = "https://files.pythonhosted.org/packages/1d/de/66bcf9244d118663b2e1aaded8990f4640e3d7b7411870a5765f252074d2/cryptography-50.0.2-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:d8947001be83df1394050758ce0e745dd74fb134eef0a4b5124208dfc3a68c37", size = 4354821, upload-time = "2026-09-30T14:44:26.263Z" }, + { url = "https://files.pythonhosted.org/packages/bd/e6/db28a28c7b6c676addce89136de3d8db49ea825a8c863472e36e42ead4ad/cryptography-50.0.2-cp314-cp314t-manylinux_2_34_aarch64.whl", hash = "sha256:4a20ce1e5cb4284a86692fdcba7cb8754185c6b2e5c56fcef3751cf451d3cdc2", size = 4716748, upload-time = "2026-09-30T14:44:28.447Z" }, + { url = "https://files.pythonhosted.org/packages/30/96/01546c7f69ea0e2ab790a2e4f0934a4052fb9b388147fbf83c2fd72f1e57/cryptography-50.0.2-cp314-cp314t-manylinux_2_34_ppc64le.whl", hash = "sha256:84f964e537f916e2cc85199e5a88742e964939b575ac8598b3f9d6cc416cdaf1", size = 5285085, upload-time = "2026-09-30T14:44:30.704Z" }, + { url = "https://files.pythonhosted.org/packages/6c/01/03263395f74d50b071e9e66daace3f8bef80493e5d410726f2ba8554736b/cryptography-50.0.2-cp314-cp314t-manylinux_2_34_x86_64.whl", hash = "sha256:828d49b0ff5a0e3975865571c5d91dbbdd0d38d8289b249a163e9425413a5e05", size = 4727268, upload-time = "2026-09-30T14:44:32.92Z" }, + { url = "https://files.pythonhosted.org/packages/eb/94/2bfe8f29ec0cc9c0d99359c4161adf32858e4934b72c6d100d2ac0bbe962/cryptography-50.0.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:deb9fde5c60e437ee4821bc9bc39ff31b42135c27e1dc61ef0a629389c1de62e", size = 4849503, upload-time = "2026-09-30T14:44:34.969Z" }, + { url = "https://files.pythonhosted.org/packages/54/44/e80651ecbf0e42b62e2bb5f5768916e07eea72e1297338956a61df361f88/cryptography-50.0.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8c71ba2cd31fc93748c38e1b613200ff1c2665cbfd5341fe3a61cfde35a1430e", size = 5004057, upload-time = "2026-09-30T14:44:37.064Z" }, + { url = "https://files.pythonhosted.org/packages/f8/cc/1d33befb3cd7ea7e77d2d73f43f2066471da1b21f24a6156efcaabf6d2e8/cryptography-50.0.2-cp314-cp314t-win_amd64.whl", hash = "sha256:78198641e5be9521beea5aa782bb551a58068d10e6eb04c9c680c1b69f2e7d45", size = 3795868, upload-time = "2026-09-30T14:44:39.71Z" }, + { url = "https://files.pythonhosted.org/packages/2d/49/93f6a6e7a87c9aa68d44d3e1cdb5fe8f60c90d5d2f46acae9a56892816b8/cryptography-50.0.2-cp315-abi3.abi3t-macosx_11_0_arm64.whl", hash = "sha256:edc3342adf8f697fc5f59c887a304356f147b397809440ed64e2fa6af2f50f37", size = 4133708, upload-time = "2026-09-30T14:44:41.807Z" }, + { url = "https://files.pythonhosted.org/packages/8c/75/32ac2a56243d778805c16ca6a32b8f74fb757df7e28d7ecb560afafb59cf/cryptography-50.0.2-cp315-abi3.abi3t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d370b8d1dfcdf7130178137f6fbee6140774a1acc6cacefc4b42643ec11d0a3a", size = 4956267, upload-time = "2026-09-30T14:44:43.693Z" }, + { url = "https://files.pythonhosted.org/packages/aa/a4/2c8d734e43d97f0842ee9f1b7b4bfb3d0cf5e19edebf43c2afe6675c2320/cryptography-50.0.2-cp315-abi3.abi3t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f2f9bd7f90c64fe89253f0a2c05e3c4856072660429ce8831b4235bf29403a67", size = 4966465, upload-time = "2026-09-30T14:44:45.769Z" }, + { url = "https://files.pythonhosted.org/packages/c2/58/ee288c829a6f41f6235ae9dd33d82fd19b45442b65b4c8a3da36963d9f7a/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl", hash = "sha256:e275096ea1e60cc595cda2836fd4a6c725d1125108b868be17f53684d164e2cc", size = 4959356, upload-time = "2026-09-30T14:44:48.211Z" }, + { url = "https://files.pythonhosted.org/packages/92/20/9ded6d51ddd9897f6b6e81fb9ebea7951d7cc5d6c890b0ed8abf77a51a80/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_28_ppc64le.whl", hash = "sha256:b13478603dcd0a2479ff8e87e2c19a7d525734686fe3c49542472293a204212d", size = 5548822, upload-time = "2026-09-30T14:44:50.86Z" }, + { url = "https://files.pythonhosted.org/packages/02/a8/8df951850d6b31d2a00218f19e2b3f999523437ed7a819df7fa427942fca/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl", hash = "sha256:58a0c478eeca76fe5e07993c5a0703def34a6dc6a0cda4f5564639b33112ffe7", size = 5001199, upload-time = "2026-09-30T14:44:53.379Z" }, + { url = "https://files.pythonhosted.org/packages/8b/f9/36b3022218ce75b7cdf068fb95f809f9bd0d820e4955ef43b90c255cc7ac/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_31_armv7l.whl", hash = "sha256:d38cdff612d06fa6a32840d5e1b1f7a27cee4a349aa9085d94a67789d6bfd408", size = 4629333, upload-time = "2026-09-30T14:44:55.635Z" }, + { url = "https://files.pythonhosted.org/packages/8c/72/20f99a219f6af47cdd1cbd978c243b92d71496e168a746138af44ded4f29/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_34_aarch64.whl", hash = "sha256:fdd28f912fccfec1846a94e2e1e8f9b0012f557f0c46fe4f3eb0d7a87afcf90b", size = 4958822, upload-time = "2026-09-30T14:44:59.639Z" }, + { url = "https://files.pythonhosted.org/packages/f2/20/196f112617fb08eb4d608a2a6c422373d46f9cc2857f38fc0667033c0899/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_34_ppc64le.whl", hash = "sha256:cbc8738fd8526d80f35cb3a40d41f41a2e7030bb3b18b09a6778ef63d291c2fd", size = 5506351, upload-time = "2026-09-30T14:45:02.267Z" }, + { url = "https://files.pythonhosted.org/packages/24/95/83378121ef3eaaaf71d4b781577ff794acb39b9e1b87a3f156898c8497ed/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_34_x86_64.whl", hash = "sha256:e105ab60406787da31fccc883fc0f733af1efd78f0136a4599692c4083a73d0c", size = 5000859, upload-time = "2026-09-30T14:45:05.009Z" }, + { url = "https://files.pythonhosted.org/packages/22/f7/70fd7ae4d1dbfa7ba29b02e1b9068771519a86027756510b700ce81086a8/cryptography-50.0.2-cp315-abi3.abi3t-musllinux_1_2_aarch64.whl", hash = "sha256:6f8700550aa1474a91e5dc07049c46f98b423b5b1ddd0483e0b51362eeeaf5be", size = 5092151, upload-time = "2026-09-30T15:29:15.932Z" }, + { url = "https://files.pythonhosted.org/packages/d4/be/688367b74de86984bd58d8efacfc7c9e68b89a6a22ced0fb4f38db50254a/cryptography-50.0.2-cp315-abi3.abi3t-musllinux_1_2_x86_64.whl", hash = "sha256:c71be1cbfa5cd9a41ee452acf1eccd82b2c05950358b106ec8ceb83411d1a020", size = 5286120, upload-time = "2026-09-30T15:29:18.309Z" }, + { url = "https://files.pythonhosted.org/packages/39/d1/55f8a3f2ef5d1529e16835ef10cf0fe3d559ce237b46dddc440c0bba3649/cryptography-50.0.2-cp315-abi3.abi3t-win_amd64.whl", hash = "sha256:c423ab384a46c4dff7217b2ea5ba2e11cffdeab6441acd04cf65a369caf0366c", size = 4111557, upload-time = "2026-09-30T15:29:20.155Z" }, + { url = "https://files.pythonhosted.org/packages/23/ad/ac987755d00e1e64273760228d2635ae38dae2be83e3c6e0d3289d91dec3/cryptography-50.0.2-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:0ec5f09541743261e66e291b4a0cbf0fb2997aeaab6d9e9c740b9dba1b58d1c2", size = 3943588, upload-time = "2026-09-30T15:29:22.265Z" }, + { url = "https://files.pythonhosted.org/packages/d5/8d/6d585339bedf85d45044c85d8412dac53f2bb6f918e8b7777efba1787844/cryptography-50.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c5e67125c7dca78d199ec4e116aa93dbb83494808ecbb8211a2cb09b1bf41dbd", size = 4756166, upload-time = "2026-09-30T15:29:24.58Z" }, + { url = "https://files.pythonhosted.org/packages/bf/f1/1c1f6874e8550cfddd4b688ceb38cefb6ed15ceed224d56f133f3d88c214/cryptography-50.0.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ee247f5c245c9a2fe7c8e2214e295918838e44e00a45a6718451e4004219e767", size = 4749145, upload-time = "2026-09-30T15:29:26.807Z" }, + { url = "https://files.pythonhosted.org/packages/c1/63/61b15dc1a8de03fe0adbe3fd7608b3ad5c73bf50993bbcb1faaa930afe33/cryptography-50.0.2-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:dfe9763530994147d9af1def057a5b9658b00e8f8fe8743d144d1e0911c2e454", size = 4763638, upload-time = "2026-09-30T15:29:28.588Z" }, + { url = "https://files.pythonhosted.org/packages/fc/35/b345bdfa40c9126df1a9d33236aa98418367931b8725f84fc3ae2b98dc59/cryptography-50.0.2-cp39-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:58ddb5a8e3179d12f19e4ea34d2d32e9d63a4baa142c875c1eb59f41b7243acd", size = 5382217, upload-time = "2026-09-30T15:29:30.589Z" }, + { url = "https://files.pythonhosted.org/packages/4f/87/ef344a9e616871f2519c22d6afcda79ddd5d35e9592d95eb6e677608d055/cryptography-50.0.2-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f21e8a22c8605750c7af886bab299a363721264061b4ac0a30efb73cfd58efc5", size = 4781387, upload-time = "2026-09-30T15:29:32.605Z" }, + { url = "https://files.pythonhosted.org/packages/90/5b/f2fdb13cd0b96f6f932c8627bb292a45f11c64d21620a8e120aee9a3b848/cryptography-50.0.2-cp39-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:9c8402a82ea0dc4ceeab793db05f0fafa8ca139ca34fcde5df0f596103c74107", size = 4403790, upload-time = "2026-09-30T15:29:34.374Z" }, + { url = "https://files.pythonhosted.org/packages/bc/ce/7e4f662b1e3c393513569e402cfc85ac7da0bd3d5435e122a3140219eb2d/cryptography-50.0.2-cp39-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:0ddc924c04591c2811ca024d62ecad4f7f6f08af8939c211438f48a16bd23602", size = 4764319, upload-time = "2026-09-30T15:29:36.149Z" }, + { url = "https://files.pythonhosted.org/packages/3c/3f/86ff33ce34cc0de6847fb96e035a1a760d81652e38643f617c02ad32ef7a/cryptography-50.0.2-cp39-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:a6557e5f38e065ca9fbdaf7cfc7435ecb1d113aa81a022d1b51921ee7432e227", size = 5338560, upload-time = "2026-09-30T15:29:39.053Z" }, + { url = "https://files.pythonhosted.org/packages/40/cf/6b5c8e2fd9202d98988ab7cb5cc5c991704c4ad55f492ff408e4969f83f1/cryptography-50.0.2-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:1981f1db4630889b9ef7803fadef12b056f428cb6b85c27ba57b774793b6093c", size = 4780973, upload-time = "2026-09-30T15:29:41.251Z" }, + { url = "https://files.pythonhosted.org/packages/10/bf/8d6ebc7dded797bd0f0160d52188021211f011a2b164ef0ae1dac4587465/cryptography-50.0.2-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:7a8701d6b584d76e909e3d305b7d126b41439876a5aaf76cddc67fc230eafa2e", size = 4897738, upload-time = "2026-09-30T15:29:43.106Z" }, + { url = "https://files.pythonhosted.org/packages/d4/aa/f3f6e0de7e6253b8baa8b2d8fb9d50924fa75cee3d4624bd4bc1208ee923/cryptography-50.0.2-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:ce47f66801c20ec6c6632453bb5960fe38939e9306970b48b3a5a26de7745d94", size = 5058280, upload-time = "2026-09-30T15:29:44.827Z" }, + { url = "https://files.pythonhosted.org/packages/f6/b6/a1faf3a27ae9405fb34b1713cc73b2d8a26b04d5c561578fa2e6ef3e5bb9/cryptography-50.0.2-cp39-abi3-win_amd64.whl", hash = "sha256:4e81d95e5bafc2d6e34e4bed780e53e4d5b9a2f928573428aa4d35fbec1eb0de", size = 3854095, upload-time = "2026-09-30T15:29:46.782Z" }, + { url = "https://files.pythonhosted.org/packages/1d/7a/f08d34ce09d60f89ebd391e2ebc6ba2b995e6dd7552f41820f8085f94e53/cryptography-50.0.2-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:92e665960f25fcdc73725b9cec7a3824f279ba97a98653afe9ffac2e43668f67", size = 4716035, upload-time = "2026-09-30T15:29:48.681Z" }, + { url = "https://files.pythonhosted.org/packages/45/67/e18fb65592451a2acb76e9f2fbe14e0f47a8318b4c5430f1633851d03daa/cryptography-50.0.2-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:eef4c2f3423810b3070ab391f85436d2f8bbfcb286ac15cbc73190b3563b1f1a", size = 4726917, upload-time = "2026-09-30T15:29:50.608Z" }, + { url = "https://files.pythonhosted.org/packages/83/28/38fdce17e60f6b825e69fc3b7f75e70a6612759980704697e1de4cbfaf6e/cryptography-50.0.2-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:7c6d0330c472d96f6a6afe24d80dfdf15176c33096f0a4397ae4c60f3dd3be48", size = 4715341, upload-time = "2026-09-30T15:29:52.522Z" }, + { url = "https://files.pythonhosted.org/packages/b6/b1/d9121a717e0f893c64bd6ca7702614778d7df2a5c309128a002421788516/cryptography-50.0.2-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:1ba34f04897fcdaa73f74145c25f3ec146fbd56593853e88adc2e811303c5f42", size = 4726322, upload-time = "2026-09-30T15:29:54.263Z" }, + { url = "https://files.pythonhosted.org/packages/36/8b/e6d153808bf353e152abd2fd4d8f09670d956ac78379ac46e60d7efbf04c/cryptography-50.0.2-pp311-pypy311_pp80-macosx_11_0_arm64.whl", hash = "sha256:3dc4fd8058cea1644971207d530e1a03a184a805ffc8ebdddf0599d78a331b81", size = 3873097, upload-time = "2026-09-30T15:29:56.097Z" }, + { url = "https://files.pythonhosted.org/packages/ca/1d/1271f287ff7170ddafc2aad36260c4eec20ccd2fea70f38455e9d56d427b/cryptography-50.0.2-pp311-pypy311_pp80-win_amd64.whl", hash = "sha256:7b75de3c8b3be1cdb1052747c929440c3eea46c1bc2cb8a6e3a48388e9b7b452", size = 3805376, upload-time = "2026-09-30T15:29:58.729Z" }, +] + [[package]] name = "exceptiongroup" version = "1.3.1" @@ -169,12 +354,14 @@ dependencies = [ [package.optional-dependencies] dev = [ + { name = "cryptography" }, { name = "pytest" }, { name = "pytest-cov" }, ] [package.metadata] requires-dist = [ + { name = "cryptography", marker = "extra == 'dev'", specifier = ">=50.0.0" }, { name = "pydantic", specifier = ">=2.5" }, { name = "pytest", marker = "extra == 'dev'", specifier = ">=7.0" }, { name = "pytest-cov", marker = "extra == 'dev'" }, @@ -199,6 +386,30 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, ] +[[package]] +name = "pycparser" +version = "3.11" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.11'", +] +sdist = { url = "https://files.pythonhosted.org/packages/da/a8/c5fdbeee588bb8ada9458774f43adf1bdd30bd59157055142183e769a024/pycparser-3.11.tar.gz", hash = "sha256:d875f09c3507d00e1aba0eecc6dcadc1352f30fff09dc6bff2f1c2935e97c2bc", size = 113796, upload-time = "2026-10-09T12:56:59.539Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/90/11/0e6f11117525ff0eec40ebac3d313376f102df93ca44ad9e893ee85e4f89/pycparser-3.11-py3-none-any.whl", hash = "sha256:51d5a8ba2be0bbe440b99d2112604c95bbbc3c2748a64260186c541e1729cd80", size = 51178, upload-time = "2026-10-09T12:56:58.131Z" }, +] + +[[package]] +name = "pycparser" +version = "3.12" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.11'", +] +sdist = { url = "https://files.pythonhosted.org/packages/cb/27/eeb9f307bf07060f3d9f9aa0fb8c15b01bdfded0a941e4b2719c7f94cacd/pycparser-3.12.tar.gz", hash = "sha256:f03387877eab82ce01bbdfd0ba7252ee55a90b1c708d5129e2ce915475cf1db6", size = 158785, upload-time = "2026-10-22T13:40:03.56Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b6/ae/315bbeee126a769cbde43cf4908acb4b40408d8bf8bbf334dd7368d8dadf/pycparser-3.12-py3-none-any.whl", hash = "sha256:a076f3f489b39b43ed13563a1dafe42447445bec2e294154ec5c57fcdda4c85e", size = 62600, upload-time = "2026-10-22T13:40:02.021Z" }, +] + [[package]] name = "pydantic" version = "2.12.5" diff --git a/tests/test_receipt_verify.py b/tests/test_receipt_verify.py index 1a95045ffb..3bbeb47232 100644 --- a/tests/test_receipt_verify.py +++ b/tests/test_receipt_verify.py @@ -8,6 +8,7 @@ from __future__ import annotations import base64 +import hashlib import json from pathlib import Path @@ -16,8 +17,8 @@ pytest.importorskip("openadapt_flow.receipt_record") -from openadapt.cli import main # noqa: E402 from openadapt_flow.receipt_record import ( # noqa: E402 + ReceiptRecordError, build_statement, local_registry, receipt_after_run, @@ -26,6 +27,8 @@ ) from openadapt_types import receipt as r # noqa: E402 +from openadapt.cli import main # noqa: E402 + BUNDLE = "2" * 64 @@ -39,19 +42,16 @@ def _isolated(tmp_path, monkeypatch): def _run(tmp_path: Path, outcome: str = "HALTED", name: str = "run") -> Path: run = tmp_path / name run.mkdir() - report = { - "run_id": f"{name}-1", - "workflow_name": "MockMed referral", - "execution_outcome": outcome, - "started_at": "2026-11-20T23:14:00Z", - "bundle_content_digest": BUNDLE, - "model_calls": 0, - "results": [ - {"ok": True, "effect_verified": True, "postconditions_ok": True}, - {"ok": outcome == "VERIFIED", "effect_verified": outcome == "VERIFIED"}, - {"ok": True}, - ], - } + fixture = "run-1" if outcome == "VERIFIED" else "run-broken" + data = Path(__file__).parent / "fixtures" / "seal_view" / fixture / "report.json" + report = json.loads(data.read_bytes()) + report.update( + run_id=f"{name}-1", + workflow_name="MockMed referral", + execution_outcome=outcome, + started_at="2026-11-20T23:14:00Z", + bundle_content_digest=BUNDLE, + ) (run / "report.json").write_text(json.dumps(report)) return run @@ -69,7 +69,9 @@ def test_a_stopped_run_gets_a_receipt_and_stays_stopped(tmp_path): assert result.ok and result.outcome == "STOPPED" assert result.signer_lines == ("Signed by this computer",) lines = result.statement["predicate"]["lines"] - assert [line["check"] for line in lines] == ["confirmed", "refuted"] + # Two contracts belong to one attempted write. The stopped run saw one + # absence but the other check never completed. + assert [(line["step"], line["check"]) for line in lines] == [(5, "not_checked")] out = _verify(str(run)) assert out.exit_code == 0, out.output assert "Signed by this computer" in out.output @@ -98,36 +100,24 @@ def test_signing_never_upgrades(run_outcome): def test_a_verified_report_with_a_refuted_write_is_not_verified(): report = { "execution_outcome": "VERIFIED", - "results": [{"ok": False, "effect_verified": False}], + "results": [ + {"step_id": "a", "intent": "save", "ok": False, "effect_verified": False} + ], } statement, _ = build_statement(report, "1" * 64, flow_version="3.5.0") assert statement["predicate"]["outcome"] == "UNKNOWN" -@pytest.mark.parametrize( - "tail,reason", - [ - ([{"effect_verified": False}], "refuted_write"), - ([{"effect_verified": True}], "too_many_writes"), - ], -) -def test_writes_past_the_line_limit_still_decide_the_outcome(tail, reason): - """A receipt shows at most MAX_LINES writes; it never says VERIFIED over - writes it left out.""" +def test_writes_past_the_line_limit_refuse_to_sign(): + """A receipt never says VERIFIED over writes it left out: more writes than + a receipt can show refuse to sign (this writer never truncates).""" from openadapt_types.receipt import MAX_LINES confirmed = [{"ok": True, "effect_verified": True}] * MAX_LINES - report = {"execution_outcome": "VERIFIED", "results": confirmed + tail} - statement, _ = build_statement(report, "1" * 64, flow_version="3.5.0") - predicate = statement["predicate"] - assert (predicate["outcome"], predicate["reason_code"]) == ("UNKNOWN", reason) - assert len(predicate["lines"]) == MAX_LINES - exact, _ = build_statement( - {"execution_outcome": "VERIFIED", "results": confirmed}, - "1" * 64, - flow_version="3.5.0", - ) - assert exact["predicate"]["outcome"] == "VERIFIED" + for tail in ([{"effect_verified": False}], [{"effect_verified": True}]): + report = {"execution_outcome": "VERIFIED", "results": confirmed + tail} + with pytest.raises(ReceiptRecordError): + build_statement(report, "1" * 64, flow_version="3.5.0") def test_a_run_folder_without_its_report_is_not_verified(tmp_path): @@ -371,6 +361,270 @@ def test_the_public_allow_list_is_inside_todays_public_fields(): assert field in known, (version, path, source) +@pytest.mark.parametrize("fixture", ["run-1", "run-broken"]) +def test_settled_receipt_covers_both_report_encodings(fixture, tmp_path): + from openadapt_flow.offline_seal import public_key_entry + from openadapt_types.receipt_callback import verified_receipt_metrics + + run = tmp_path / fixture + run.mkdir() + source = Path(__file__).parent / "fixtures" / "seal_view" / fixture / "report.json" + raw = source.read_bytes() + (run / "report.json").write_bytes(raw) + envelope = write_receipt_record(run) + entry = public_key_entry() + pin = {key: entry[key] for key in ("key_id", "public_key")} + canonical = r.report_canonical_sha256(json.loads(raw)) + exact = hashlib.sha256(raw).hexdigest() + assert canonical != exact + legacy = hashlib.sha256(r.canonical_json(json.loads(raw)).encode()).hexdigest() + checked = r.verify_receipt(envelope, local_registry()) + assert checked.ok + subjects = {s["name"]: s["digest"]["sha256"] for s in checked.statement["subject"]} + assert ( + subjects["report.json"] == exact + and subjects["report.canonical"] == canonical + ) + lines = checked.statement["predicate"]["lines"] + assert len(lines) == 1 and lines[0]["step"] == 5 + assert (lines[0]["check"], lines[0]["strength"]) == ( + ("confirmed", "read_back") + if fixture == "run-1" + else ("not_checked", "same_screen") + ) + wire = (run / "receipt.json").read_bytes() + assert verified_receipt_metrics( + wire, pinned_signer=pin, report_jcs_sha256=canonical, outcome=checked.outcome + ) == { + "receipt_record": envelope, + "receipt_record_signer": pin, + } + with pytest.raises(ValueError, match="canonical report"): + verified_receipt_metrics( + wire, pinned_signer=pin, report_jcs_sha256=exact, outcome=checked.outcome + ) + if legacy != canonical: + with pytest.raises(ValueError, match="canonical report"): + verified_receipt_metrics( + wire, pinned_signer=pin, report_jcs_sha256=legacy, outcome=checked.outcome + ) + with pytest.raises(ValueError, match="outcome"): + verified_receipt_metrics( + wire, pinned_signer=pin, report_jcs_sha256=canonical, outcome="FAILED" + ) + if fixture == "run-broken": + # A stopped execution can still need reconciliation for a possible write. + precise_outcome = r.receipt_outcome(json.loads(raw)["transaction_outcome"])[0] + assert (checked.outcome, precise_outcome) == ("STOPPED", "UNKNOWN") + with pytest.raises(ValueError, match="outcome"): + verified_receipt_metrics( + wire, + pinned_signer=pin, + report_jcs_sha256=canonical, + outcome=precise_outcome, + ) + assert write_receipt_record(run) == envelope + (run / "report.json").write_bytes(raw + b"\n") + with pytest.raises(ReceiptRecordError, match="already_signed"): + write_receipt_record(run) + assert (run / "receipt.json").read_bytes() == wire + + +def test_incomplete_or_excess_write_evidence_cannot_appear_verified(): + result = { + "step_id": "save", + "intent": "save", + "effect_verified": False, + "ok": False, + "risk": "irreversible", + } + report = {"execution_outcome": "VERIFIED", "results": [result]} + statement, _ = build_statement(report, "a" * 64) + assert statement["predicate"]["outcome"] == "UNKNOWN" + assert statement["predicate"]["lines"][0]["check"] == "not_checked" + for key in ("delivery_attempted", "skipped"): + report["results"] = [{**result, key: key == "skipped"}] + statement, _ = build_statement(report, "a" * 64) + assert statement["predicate"]["lines"] == [] + report["results"] = [result] * (r.MAX_LINES + 1) + with pytest.raises(ReceiptRecordError, match="too_many_writes"): + build_statement(report, "a" * 64) + + +def test_signing_preserves_conflicting_legacy_files(tmp_path): + run = _run(tmp_path) + old = b'{"schema_version":"openadapt.run-receipt/v2"}' + other = b'{"schema_version":"openadapt.run-receipt/v2","other":true}' + (run / "receipt.json").write_bytes(old) + (run / "run-summary.json").write_bytes(other) + with pytest.raises(ReceiptRecordError, match="legacy_summary_conflict"): + write_receipt_record(run) + assert (run / "receipt.json").read_bytes() == old + assert (run / "run-summary.json").read_bytes() == other + assert not (run / r.PRIVATE_FILE).exists() + + +def test_reuse_requires_the_original_signer_and_intact_openings(tmp_path, monkeypatch): + run = _run(tmp_path) + envelope = write_receipt_record(run) + home = tmp_path / "other-home" + with monkeypatch.context() as patch: + patch.setenv("OPENADAPT_SEAL_HOME", str(home)) + with pytest.raises(ReceiptRecordError, match="existing_unverified"): + write_receipt_record(run) + (run / r.PRIVATE_FILE).write_text("{}") + with pytest.raises(ReceiptRecordError, match="existing_unverified"): + write_receipt_record(run) + assert json.loads((run / r.RECEIPT_FILE).read_bytes()) == envelope + + +def test_new_finalizer_requires_explicit_opt_in_and_waits_for_settlement(tmp_path): + run = _run(tmp_path) + assert receipt_after_run(run, env={}, require_opt_in=True) is None + assert not (run / r.RECEIPT_FILE).exists() + path = run / "report.json" + report = json.loads(path.read_bytes()) + report["transaction_outcome"] = "SAVED_AWAITING_CHECK" + path.write_text(json.dumps(report)) + assert "readback_pending" in receipt_after_run( + run, env={"OPENADAPT_RECEIPT": "on"}, require_opt_in=True + ) + assert not (run / r.RECEIPT_FILE).exists() + + +@pytest.mark.parametrize("finalizer", ["cli", "pool"]) +def test_completed_unverified_no_write_uses_actual_report_serialization( + tmp_path, monkeypatch, finalizer +): + from unittest.mock import patch + + import openadapt_flow.__main__ as cli + from openadapt_flow import receipt_record + from openadapt_flow.ir import RunReport, Workflow + from openadapt_flow.offline_seal import public_key_entry + from openadapt_flow.transaction import stamp_transaction_outcome + from openadapt_types.receipt_callback import verified_receipt_metrics + + report = RunReport( + workflow_name="read", + started_at="2026-11-20T23:14:00Z", + execution_profile="demo", + execution_outcome="COMPLETED_UNVERIFIED", + results=[], + ) + stamp_transaction_outcome(report, Workflow(name="read", steps=[])) + assert report.transaction_outcome == "COMPLETED_UNVERIFIED" + path = report.save(tmp_path) + if finalizer == "cli": + monkeypatch.setattr( + cli, "_cmd_replay", lambda args: cli._finish_replay(tmp_path, report, args) + ) + with patch.object( + receipt_record, "receipt_after_run", wraps=receipt_record.receipt_after_run + ) as sign: + cli.main(["replay", str(tmp_path / "unused"), "--run-dir", str(tmp_path)]) + sign.assert_called_once_with(tmp_path, require_opt_in=False, expected_report=report) + else: + from openadapt_flow.cli_worklist_pool import _item_run + + monkeypatch.setenv("OPENADAPT_RECEIPT", "on") + _item_run(report, None, tmp_path) + envelope = json.loads((tmp_path / r.RECEIPT_FILE).read_bytes()) + entry = public_key_entry() + digest = r.report_canonical_sha256(json.loads(path.read_bytes())) + keys = {name: entry[name] for name in ("key_id", "public_key")} + checked = r.verify_receipt(envelope, local_registry()) + assert checked.ok and checked.outcome == "UNKNOWN" + assert checked.statement["predicate"]["lines"] == [] + assert ( + verified_receipt_metrics( + (tmp_path / r.RECEIPT_FILE).read_bytes(), + pinned_signer=keys, + report_jcs_sha256=digest, + outcome=r.receipt_outcome(report.transaction_outcome)[0], + )["receipt_record"] + == envelope + ) + + +def test_cli_refusal_cannot_sign_a_prior_report(tmp_path, monkeypatch): + from unittest.mock import Mock + + import openadapt_flow.__main__ as cli + from openadapt_flow import offline_seal + + run = _run(tmp_path) + monkeypatch.setattr(cli, "_cmd_replay", lambda args: 2) + legacy = Mock(return_value=None) + monkeypatch.setattr(offline_seal, "seal_after_run", legacy) + result = cli.main(["replay", str(tmp_path / "unused"), "--run-dir", str(run)]) + assert result == 2 + legacy.assert_called_once_with(run) + assert not (run / r.RECEIPT_FILE).exists() + + +def test_refuses_folder_with_another_finalizers_report(tmp_path): + from openadapt_flow.ir import RunReport + + other = RunReport(workflow_name="other", started_at="2026-11-21T00:00:00Z") + run = _run(tmp_path) + assert "report_changed" in receipt_after_run(run, expected_report=other) + assert not (run / r.RECEIPT_FILE).exists() + + +def test_legacy_summary_recognized_by_schema_under_any_filename(tmp_path): + from openadapt_flow.ir import RunReport + from openadapt_flow.receipt import build_receipt, read_run_summary + + run = tmp_path / "run" + run.mkdir() + fixture = Path(__file__).parent / "fixtures" / "seal_view" / "run-1" / "report.json" + raw = fixture.read_bytes() + (run / "report.json").write_bytes(raw) + report = RunReport.model_validate_json(raw) + legacy = build_receipt(report).model_dump_json().encode() + old = run / "receipt.json" + old.write_bytes(legacy) + assert read_run_summary(run)["schema_version"] == "openadapt.run-receipt/v2" + write_receipt_record(run) + assert (run / "run-summary.json").read_bytes() == legacy + assert read_run_summary(run)["schema_version"] == "openadapt.run-receipt/v2" + alternative = run / "audit-export.json" + alternative.write_bytes(legacy) + result = _verify(str(alternative)) + assert "run-receipt/v2" in result.output + + +def test_declared_but_unbound_effect_stays_visible(): + report = { + "execution_outcome": "HALTED", + "results": [ + { + "step_id": "save", + "intent": "save", + "ok": False, + "delivery_attempted": True, + } + ], + "change_ledger": [ + { + "step_id": "save", + "position": 1, + "status": "unknown", + "effects": [{"contract_hash": None, "status": "unknown"}], + } + ], + } + statement, _ = build_statement(report, "a" * 64) + (line,) = statement["predicate"]["lines"] + assert (statement["predicate"]["outcome"], line["check"], line["strength"]) == ( + "STOPPED", + "not_checked", + "none", + ) + assert "effect_not_declared" not in line["not_checked"] + + def _approved_run(tmp_path: Path, approvals: list, mode: str = "each_item") -> Path: """A run whose report carries Flow's own approval block, built by its model.""" from openadapt_flow.approval_mode.model import ( @@ -410,7 +664,8 @@ def _approved_run(tmp_path: Path, approvals: list, mode: str = "each_item") -> P def test_an_approved_runs_receipt_records_the_mode_and_approver_kind(tmp_path): run = _approved_run(tmp_path, [PERSON_APPROVAL]) - write_receipt_record(run) + envelope = write_receipt_record(run) + assert write_receipt_record(run) == envelope payload = base64.b64decode( json.loads((run / "receipt.json").read_text())["payload"] ) @@ -615,3 +870,27 @@ def test_a_receipt_names_both_report_digests(tmp_path): report["model_calls"] = 3 (run / "report.json").write_text(json.dumps(report, indent=4)) assert not verify_run_receipt(run, local_registry()).ok + + +@pytest.mark.parametrize("status", ["pending", "approved", "continuing"]) +def test_durable_pause_cannot_be_signed(tmp_path, status): + from openadapt_flow.runtime.durable.checkpoint import ( + CheckpointStore, + PendingEscalation, + ) + + run = _run(tmp_path) + store = CheckpointStore(run) + store.write_pending( + PendingEscalation( + workflow_name="read", + step_index=0, + step_id="save", + category="effect_escalated", + status=status, + ) + ) + with pytest.raises(ReceiptRecordError, match="restartable_run"): + write_receipt_record(run) + assert not (run / r.RECEIPT_FILE).exists() + assert not (run / r.PRIVATE_FILE).exists()