diff --git a/capabilities/04-the-core-a-checked-entry-every-time/0132-one-receipt-word-per-check-the-same-on-every.md b/capabilities/04-the-core-a-checked-entry-every-time/0132-one-receipt-word-per-check-the-same-on-every.md index d4682fe469..e2c16379c8 100644 --- a/capabilities/04-the-core-a-checked-entry-every-time/0132-one-receipt-word-per-check-the-same-on-every.md +++ b/capabilities/04-the-core-a-checked-entry-every-time/0132-one-receipt-word-per-check-the-same-on-every.md @@ -1 +1 @@ -| One receipt word per check, the same on every path: `VERIFIED` only at level 3 (a separate session) or 4 (the system of record), always with the basis that produced the evidence (`separate_session`, `system_api`, `activity_log`, `db_frame` or `owned_connection`); `SHOWN` for an acting-screen re-read, `CONFIRMED` for the counterparty, `ATTESTED` for an operator and `RECORDED` for the rest. `VERIFIED` means "as of the read-back time the read-back showed this value", not "persisted". Run receipts (`record/run/v1`, an additive optional field), `verify-run` receipts and `tx` receipts carry an evidence-scope block: level, basis, word, the wire channel watched, the read-back time, the recheck window, and what it did not cover (always server-side async and outbound effects; a run receipt says it has no per-read time). A run receipt never says `VERIFIED` below level 3. Receipts without the block still verify. A `verify-run` contract with `minimum_effect_strength: independent_session` now verifies on a separate-session read | On main | Unit tests (parity across the runtime report, `verify-run`, `tx` and Execute v1; fake verifiers) | `openadapt_types/check_level.py`, `openadapt_types/evidence_scope.py`, `openadapt_flow/evidence_basis.py` | +| One receipt word per check, the same on every path: `VERIFIED` always names the basis that earned it. The baseline is the check a careful person does after a save, basis `post_save_screen` (level 1): the form left edit mode, no error is shown, and every intended value was read on the screen, field by field, and matched; a banner or toast alone never earns it, and a value that was not read means `RECORDED`. The same check after reopening the record is `reopened_record` (level 2); stronger evidence is a stronger basis on the same word (`separate_session` or `fresh_reload` at level 3; `system_api`, `activity_log`, `db_frame` or `owned_connection` at level 4). A run or policy can require a stronger level: under `Regulated` a screen check is not `VERIFIED`. `CONFIRMED` is the counterparty, `ATTESTED` an operator and `RECORDED` the rest. `VERIFIED` means "as of the read-back time the read-back showed this value", not "persisted". Run receipts (`record/run/v1`, an additive optional field), `verify-run` receipts, `tx` receipts and the kernel's receipt bridge carry an evidence-scope block: level, basis, word, the wire channel watched, the read-back time, the recheck window, and what it did not cover (always server-side async and outbound effects). `openadapt.wrap` takes its word from the Contract's read-back receipt; a declared `checked_how` alone is `RECORDED`. In a browser the runtime records each save's post-save screen check (counts and flags only); on a backend that can't read the page, a run checked only on its screen gets a `RECORDED` receipt. When reloading can't repeat the save, the runtime then reopens the record on a fresh page load and reads every value again (`reopened_record`, level 2); a value the browser showed but the server didn't keep stops the run. Where it can't reopen safely, the check stays at level 1 and such a value can pass. Older receipts that say `SHOWN` still verify and are labelled as the older format. Receipts without the block still verify | On main | Unit tests (shared cases across the types ladder, the run receipt block, the kernel bridge and `openadapt.wrap`; signed `record/run/v1` vectors checked by the Python and JavaScript verifiers); real headless runs on MockMed, compiled without database access: a clean save's receipt is `VERIFIED` / `reopened_record`, and a save whose note the server dropped stops at the reopen (`packages/flow/benchmark/post_save_screen/`). Not yet shown on a held-out app | `openadapt_types/check_level.py`, `openadapt_types/evidence_scope.py`, `openadapt_flow/evidence_basis.py`, `openadapt_kernel/receipt_bridge.py`, `openadapt/wrap_sdk.py` | diff --git a/openadapt/receipt_verify.py b/openadapt/receipt_verify.py index 8dd799709b..64c4528f23 100644 --- a/openadapt/receipt_verify.py +++ b/openadapt/receipt_verify.py @@ -69,6 +69,9 @@ def _describe(result: Any, say: Say, indent: str = " ") -> None: + (f" ({reason})" if reason else "") + ", as the run recorded it. A receipt doesn't grade the run." ) + scope = predicate.get("evidence_scope") + if isinstance(scope, dict): + say(f"{indent}{_check_line(scope)}") checks = predicate.get("checks", {}) lines = predicate.get("lines", []) say( @@ -81,6 +84,25 @@ def _describe(result: Any, say: Say, indent: str = " ") -> None: say(f"{indent}{name}: {value}") +def _check_line(scope: dict[str, Any]) -> str: + """One line naming how the run's writes were checked, from its + evidence-scope block. An older ``SHOWN`` block says it is the older + format.""" + + word = _one_line(scope.get("word")) + level = _one_line(scope.get("check_level")) + # The one older word, named here so the label works with any installed + # openadapt-types (``openadapt_types.evidence_scope.LEGACY_WORDS``). + if scope.get("word") == "SHOWN": + return ( + f"Check: {word} ({OLDER}: the acting screen was read again; level {level})" + ) + basis = scope.get("basis") + return f"Check: {word} (level {level}" + ( + f", basis {_one_line(basis)})" if basis else ")" + ) + + def verify_record_file( path: Path, registry: Sequence[Any], diff --git a/openadapt/seal_view/viewer.html b/openadapt/seal_view/viewer.html index 0b6c9678d6..ddd95d8865 100644 --- a/openadapt/seal_view/viewer.html +++ b/openadapt/seal_view/viewer.html @@ -15,16 +15,16 @@
- diff --git a/openadapt/wrap_sdk.py b/openadapt/wrap_sdk.py index 8f266dea40..3cf30ab99b 100644 --- a/openadapt/wrap_sdk.py +++ b/openadapt/wrap_sdk.py @@ -58,6 +58,7 @@ "check_wrap_receipt", "verify_wrap_receipt", "wrap", + "wrap_receipt_word", ] F = TypeVar("F", bound=Callable[..., Any]) @@ -627,6 +628,71 @@ def _receipt_names(data: Mapping[str, Any]) -> set[str]: return names +def wrap_receipt_word( + receipt: WrapReceipt | Mapping[str, Any], + contract_receipt: Mapping[str, Any] | None = None, +) -> str: + """The receipt word for a wrap receipt, the same word every path uses. + + A wrap receipt carries no evidence of its own: ``checked_how`` is what the + caller declared for its check, not what was read. So only a Contract's + read-back can earn a word stronger than ``RECORDED``. Pass that read-back's + receipt (``contract_receipt``, a ``verify-run`` receipt whose digest is the + wrap receipt's ``contract_receipt_sha256``) and the word is the one its + evidence-scope block states, for example ``VERIFIED`` with basis + ``system_api``. Anything else is ``RECORDED``: a wrap receipt whose own + digest does not match its fields, an outcome other than confirmed, no + contract receipt, a contract digest that does not match, a contract + receipt that fails ``verify-run``'s own checks or whose outcome is not + ``verified``, or a block that does not validate. This checks integrity, not who signed: use + :func:`check_wrap_receipt` for that. + + The word is derived, never signed, so receipts keep their exact bytes. + """ + + data = receipt.to_dict() if isinstance(receipt, WrapReceipt) else receipt + if ( + not isinstance(data, Mapping) + or data.get("schema") != RECEIPT_SCHEMA + or data.get("outcome") != WrapOutcome.CONFIRMED.value + ): + return "RECORDED" + try: + if _sha256_hex(_digest_payload(data)) != data.get("sha256"): + return "RECORDED" + except (TypeError, ValueError): + return "RECORDED" + digest = data.get("contract_receipt_sha256") + if not isinstance(contract_receipt, Mapping) or not isinstance(digest, str): + return "RECORDED" + try: + from openadapt_flow.verifier import Outcome, classify + from openadapt_flow.verify_run import receipt_problem, receipt_sha256 + from openadapt_types.evidence_scope import evidence_scope_problem + except ImportError: # pragma: no cover - the flow extra is not installed + return "RECORDED" + try: + if receipt_sha256(contract_receipt) != digest: + return "RECORDED" + if receipt_problem(contract_receipt) is not None: + return "RECORDED" + # Only an outcome verify-run classifies as confirmed supports the + # wrapper's "confirmed" (a verified rollback, for one, does not). + confirmed, _retry = classify( + str(contract_receipt.get("outcome")), + contract_receipt.get("checked") or {}, + {}, + ) + if confirmed is not Outcome.CONFIRMED: + return "RECORDED" + except (TypeError, ValueError, KeyError, AttributeError): + return "RECORDED" + block = contract_receipt.get("evidence_scope") + if evidence_scope_problem(block) is not None: + return "RECORDED" + return str(block["word"]) # type: ignore[index] + + def check_wrap_receipt( receipt: WrapReceipt | Mapping[str, Any], *, diff --git a/packages/flow/benchmark/post_save_screen/README.md b/packages/flow/benchmark/post_save_screen/README.md new file mode 100644 index 0000000000..f3c57a7060 --- /dev/null +++ b/packages/flow/benchmark/post_save_screen/README.md @@ -0,0 +1,64 @@ +# Post-save screen check: real-run evidence + +The basis `post_save_screen` (level 1) means that, after the save, the form left edit mode, no error appeared, and every value the run typed was read on the screen under its label and matched. `reopened_record` (level 2) means the same check also held after the record was reopened on a fresh page load, the way a careful person reopens it. + +This folder holds evidence from real headless runs on MockMed, the bundled synthetic clinic. It is in-house evidence: MockMed was changed for this work, so it is not a held-out app. + +## What was run (2026-11-30 to 12-01) + +`run_proof.py` records the quickstart's MockMed task in headless Chromium. It then compiles the recording as a customer without database access would get it: the system-of-record snapshots are removed, so the compiler mines an on-screen read-back for the save instead of a database check. It runs the program with the on-screen verifier only (no database or API), under the `standard` profile, and signs the run receipt. + +Two choices are made by the script, standing in for the person who reviews the program: + +- It keeps the read-back on the save step and removes the ones the compiler attached to four navigation clicks (#2858). Those are demonstrated read-backs that nobody admitted, and the runtime refuses to run with them. +- It uses the `permissive` policy. The strict packs (`clinical-write`, `record-write`) require a database effect and an idempotency key, which a customer without database access can't provide (#2859). + +## Results + +| Run | Outcome | Receipt | +| --- | --- | --- | +| Clean save, `standard` profile | `VERIFIED` | `VERIFIED`, basis `reopened_record`, level `reopened`. The post-save check read 1 of 1 fields and matched it; the form closed and no error appeared. The record, reopened on a fresh page load, showed the note again. Both the Python and JavaScript verifiers accept the receipt. | +| `?fault=partial` (the server stores the encounter without its note; the page still shows it) | Halted at the save | None: a halted durable run can still continue, so no receipt is signed. The reopened record showed 0 of 1 saved values (`run-partial-standard.txt`). | +| Clean save, `regulated` profile | Refused before running | The run gate requires a separate-session or system-of-record check (`gate-regulated.txt`). | +| `?fault=timeout` (MockMed shows "Save timed out" and the form stays open) | Halted | None. The save's expected screen never appeared. | + +`probe-views.json` drives MockMed directly. For each fault mode, starting from an empty record store, it records the check right after the save and again after reopening the record: + +| Fault | What the page shows after Save | After the save | After the reopen | +| --- | --- | --- | --- | +| `ok` | The encounter row `Type: Triage \| Note: ` | Complete | Complete | +| `timeout` | "Save timed out", form still open | Nothing read; error; form open | (not reached by the runtime) | +| `session` | The login page | Nothing read | Nothing read | +| `partial` | The note as saved; the server stored it without the note | Complete | Note missing | +| `optimistic` | The note as saved; the server refused the write | Complete | Note missing | + +Right after the save, `partial` and `optimistic` look complete, because MockMed paints the saved encounter from the browser's own memory. Reopening the record loads it from the server, and the note is missing, so the runtime stops. A person who reopens the record would see the same thing. + +## What a reopened check still can't see + +- **Identical older records.** An older record with the same values that first appears after the save can't be told apart from the new one without record identity. The probe resets the store between faults for this reason. +- **Saves it can't reopen safely.** Reloading counts as safe when the save didn't load a new page, or when the new page's address has no query string. Otherwise, and on backends that can't reopen (desktop, Citrix, RDP), the check stays at level 1, and a value the server dropped while the page still shows it can pass. +- **Later and outbound effects.** Effects that happen on the server later, or are sent elsewhere, are outside any read-back. Every receipt lists them as not covered. + +## What was changed to get here + +- **MockMed record view: labelled fields.** The patient record view shows each saved encounter's fields with their labels (`Type: Triage | Note: `), as a real EMR's record view does. Before, the note showed only inside the "Encounter saved" banner and an unlabelled `Triage โ€” ` line, so no field-by-field read was possible. +- **MockMed record view: loaded from the server.** With the fault backend, a fresh page load reads the saved encounters from the server (`/api/db`). Before, MockMed kept them only in the page, so reopening a record showed nothing for any fault. +- **Compiler.** A same-screen read-back reads the saved value where the record shows it under its label (`effect_mining.mark_labelled_field`), not the banner the demonstration settled on. +- **Runtime.** After a complete post-save check, it reopens the record when that is safe and reads it again. + +## Not shown yet + +This hasn't been shown on an app that didn't motivate the work, a held-out app such as OpenEMR's encounter view. + +## Files + +| File | Contents | +| --- | --- | +| `receipt-ok-standard.json` | The clean save's signed receipt | +| `registry-public.json` | The public key that signed it | +| `receipt-verify-python.txt`, `receipt-verify-js.txt` | The two verifiers' output | +| `summary-ok-standard.json` | The receipt and report summary | +| `run-partial-standard.txt` | The `partial` run's halt | +| `gate-regulated.txt` | The regulated run's gate refusal | +| `probe-views.json` | The per-fault checks after the save and after the reopen | diff --git a/packages/flow/benchmark/post_save_screen/probe_views.py b/packages/flow/benchmark/post_save_screen/probe_views.py new file mode 100644 index 0000000000..1c8dd36a08 --- /dev/null +++ b/packages/flow/benchmark/post_save_screen/probe_views.py @@ -0,0 +1,82 @@ +"""The post-save screen check on MockMed's real pages, for each fault. + +Drives MockMed in headless Chromium the way a person would (open the patient, +start a triage encounter, type the note, press Save), takes the page view the +runtime takes before and after the save, reopens the record on a fresh page +load, and prints the check +(:func:`openadapt_flow.runtime.post_save_screen.observe`) after the save and +after the reopen, for each fault mode. + +Usage (from packages/flow):: + + python benchmark/post_save_screen/probe_views.py [OUT.json] + +Synthetic data only; needs a local Chromium for Playwright. +""" + +from __future__ import annotations + +import json +import sys +import time +from pathlib import Path + +NOTE = "Follow-up in two weeks" +FAULTS = ("ok", "timeout", "session", "partial", "optimistic") + + +def probe(base_url: str, fault: str) -> dict: + import urllib.request + + from openadapt_flow.backends.playwright_backend import PlaywrightBackend + from openadapt_flow.runtime.post_save_screen import observe + + # Each fault starts from an empty record store, so an earlier probe's + # record (same note) can't stand in for this one. + urllib.request.urlopen( + urllib.request.Request(f"{base_url}/api/reset", data=b"{}", method="POST") + ).read() + + backend, close = PlaywrightBackend.launch( + f"{base_url}/?fault={fault}#tasks", headless=True + ) + try: + page = backend.page + page.click("#open-p1") + page.click("#new-encounter") + page.click("#type-triage") + page.fill("#note", NOTE) + before = backend.post_save_view() + page.click("#save-encounter") + time.sleep(2.0) # past MockMed's 1.2 s client timeout + after = backend.post_save_view() + # Reopen the record the way a person would: a fresh load of the page. + reopened = backend.reopen_view() + finally: + close() + intended = [("Note", NOTE)] + check = observe(before, after, intended) + again = observe(before, reopened, intended) + return { + "after_save": check.model_dump(mode="json") if check is not None else {}, + "after_reopen": again.model_dump(mode="json") if again is not None else {}, + } + + +def main() -> int: + from openadapt_flow.mockmed.fault_server import serve + + base_url, _db, stop = serve(port=0) + try: + results = {fault: probe(base_url.rstrip("/"), fault) for fault in FAULTS} + finally: + stop() + text = json.dumps(results, indent=2) + print(text) + if len(sys.argv) > 1: + Path(sys.argv[1]).write_text(text + "\n") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/packages/flow/benchmark/post_save_screen/results/2026-11-30/probe-views.json b/packages/flow/benchmark/post_save_screen/results/2026-11-30/probe-views.json new file mode 100644 index 0000000000..c78d13a007 --- /dev/null +++ b/packages/flow/benchmark/post_save_screen/results/2026-11-30/probe-views.json @@ -0,0 +1,102 @@ +{ + "ok": { + "after_save": { + "fields_intended": 1, + "fields_read": 1, + "fields_matched": 1, + "left_edit_mode": true, + "error_shown": false, + "banner_only": false, + "reopened": false + }, + "after_reopen": { + "fields_intended": 1, + "fields_read": 1, + "fields_matched": 1, + "left_edit_mode": true, + "error_shown": false, + "banner_only": false, + "reopened": false + } + }, + "timeout": { + "after_save": { + "fields_intended": 1, + "fields_read": 0, + "fields_matched": 0, + "left_edit_mode": false, + "error_shown": true, + "banner_only": false, + "reopened": false + }, + "after_reopen": { + "fields_intended": 1, + "fields_read": 0, + "fields_matched": 0, + "left_edit_mode": false, + "error_shown": false, + "banner_only": false, + "reopened": false + } + }, + "session": { + "after_save": { + "fields_intended": 1, + "fields_read": 0, + "fields_matched": 0, + "left_edit_mode": true, + "error_shown": false, + "banner_only": false, + "reopened": false + }, + "after_reopen": { + "fields_intended": 1, + "fields_read": 0, + "fields_matched": 0, + "left_edit_mode": true, + "error_shown": false, + "banner_only": false, + "reopened": false + } + }, + "partial": { + "after_save": { + "fields_intended": 1, + "fields_read": 1, + "fields_matched": 1, + "left_edit_mode": true, + "error_shown": false, + "banner_only": false, + "reopened": false + }, + "after_reopen": { + "fields_intended": 1, + "fields_read": 0, + "fields_matched": 0, + "left_edit_mode": true, + "error_shown": false, + "banner_only": false, + "reopened": false + } + }, + "optimistic": { + "after_save": { + "fields_intended": 1, + "fields_read": 1, + "fields_matched": 1, + "left_edit_mode": true, + "error_shown": false, + "banner_only": false, + "reopened": false + }, + "after_reopen": { + "fields_intended": 1, + "fields_read": 0, + "fields_matched": 0, + "left_edit_mode": true, + "error_shown": false, + "banner_only": false, + "reopened": false + } + } +} diff --git a/packages/flow/benchmark/post_save_screen/results/2026-11-30/receipt-ok-standard.json b/packages/flow/benchmark/post_save_screen/results/2026-11-30/receipt-ok-standard.json new file mode 100644 index 0000000000..9dfea34609 --- /dev/null +++ b/packages/flow/benchmark/post_save_screen/results/2026-11-30/receipt-ok-standard.json @@ -0,0 +1,10 @@ +{ + "payload": "eyJfdHlwZSI6Imh0dHBzOi8vaW4tdG90by5pby9TdGF0ZW1lbnQvdjEiLCJwcmVkaWNhdGUiOnsiY2hlY2tzIjp7ImF1dGhvcml6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LM9HQOkDxRd43jYV/K3omQgkpD7vMNVeLqsYYfUVfRKz8HWy7TLkd47HM+OE0nBV+7YBjhm9F9SrZwDg==" + } + ] +} diff --git a/packages/flow/benchmark/post_save_screen/results/2026-11-30/registry-public.json b/packages/flow/benchmark/post_save_screen/results/2026-11-30/registry-public.json new file mode 100644 index 0000000000..b669d6f40f --- /dev/null +++ b/packages/flow/benchmark/post_save_screen/results/2026-11-30/registry-public.json @@ -0,0 +1 @@ +{"schema": "openadapt.receipt-keys/v1", "keys": [{"key_id": "seal-ed25519-accd03a9246d29bb", "public_key": "JpfLXYLyY0CVqHz4tHY8eTyC9e7ggpoxLPq6ITgDeHU=", "role": "this_computer", "status": "active"}]} \ No newline at end of file diff --git a/packages/flow/benchmark/post_save_screen/results/2026-11-30/summary-ok-standard.json b/packages/flow/benchmark/post_save_screen/results/2026-11-30/summary-ok-standard.json new file mode 100644 index 0000000000..0a03e43547 --- /dev/null +++ b/packages/flow/benchmark/post_save_screen/results/2026-11-30/summary-ok-standard.json @@ -0,0 +1,30 @@ +{ + "outcome": "VERIFIED", + "reason_code": "verified", + "word": "VERIFIED", + "basis": "reopened_record", + "check_level": "reopened", + "readback": { + "minimum": "same_screen", + "checked_how": "reopened", + "label": "Reopened in the same session", + "below_minimum": false, + "saves": [ + { + "step_id": "step_005", + "checked_how": "reopened", + "flow_tier": 4, + "screen_check": { + "fields_intended": 1, + "fields_read": 1, + "fields_matched": 1, + "left_edit_mode": true, + "error_shown": false, + "banner_only": false, + "reopened": true + } + } + ] + }, + "execution_outcome": "VERIFIED" +} diff --git a/packages/flow/benchmark/post_save_screen/run_proof.py b/packages/flow/benchmark/post_save_screen/run_proof.py new file mode 100644 index 0000000000..a4e1333b9d --- /dev/null +++ b/packages/flow/benchmark/post_save_screen/run_proof.py @@ -0,0 +1,185 @@ +"""Prove the post-save screen check on a real headless run. + +The quickstart's MockMed task, compiled the way a customer without database +access gets it: the recording keeps no system-of-record snapshots, so the +compiler mines an on-screen read-back for the save instead of a database +check, and the run uses no effect verifier. The run then signs its receipt. + +Usage (from packages/flow):: + + python benchmark/post_save_screen/run_proof.py OUT_DIR [--fault ok|timeout] + +``--fault ok`` is the clean save. ``--fault timeout`` makes MockMed show +"Save timed out" with the form still open; its receipt must not be VERIFIED. +Writes OUT_DIR/run--