Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

## Unreleased

### Requirements

- Accepts openadapt-flow 4: the launcher's Flow requirement and `openadapt
doctor`'s supported range are now `>=3.3.0,<5.0.0` (was `<4.0.0`).

### Features

- **Agent-to-agent handoffs.**
Expand Down
2 changes: 1 addition & 1 deletion docs/platform-compatibility-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- Generated by scripts/render_platform_versions.py. Do not edit. -->

- Generated: `2026-11-19T21:28:04+00:00`
- Generated: `2026-11-22T12:49:07+00:00`
- Selection: `explicit-published`
- Compatibility: **dependency-compatible**
- Signature: `unsigned (signing infrastructure pending)`
Expand Down
7 changes: 4 additions & 3 deletions openadapt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1341,8 +1341,9 @@ def _warn_about_launcher_conflicts() -> None:
# public_seal module, and the quickstart's encrypted checkpoints rely on its
# key derivation once per store. Launcher 1.23 requires Flow 3.3: the OpenEMR
# quickstart's referral program checks its date picker against the run's
# clock (`Postcondition.text_clock`), which Flow 3.2 ignores.
_SUPPORTED_FLOW_RANGE = ">=3.3.0,<4.0.0"
# clock (`Postcondition.text_clock`), which Flow 3.2 ignores. Flow 4.0
# removes and renames APIs the launcher doesn't use, so it is accepted too.
_SUPPORTED_FLOW_RANGE = ">=3.3.0,<5.0.0"
_RDP_INSTALL_COMMAND = _pip_install("openadapt[rdp]")
_CHROMIUM_SYSTEM_LIBS_COMMAND = (
f"{shlex.quote(sys.executable)} -m playwright install-deps chromium"
Expand All @@ -1352,7 +1353,7 @@ def _warn_about_launcher_conflicts() -> None:
def _supported_flow_version(value: str) -> bool:
"""Return whether a stable Flow version is in the launcher's supported range."""
parsed = _release_tuple(value)
return parsed is not None and (3, 3, 0) <= parsed < (4, 0, 0)
return parsed is not None and (3, 3, 0) <= parsed < (5, 0, 0)


# The Python modules each native or remote Flow backend imports when its
Expand Down
2 changes: 1 addition & 1 deletion packages/flow/docs/HARNESS2.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ they are, and turns the outcome into one number for ranking:
| `wrong_effect`: reported saved, but no record landed | -0.5 |
| A record landed on another patient | -1.0 |
| The patient got more than one record | -1.0 |
| `escalated_after_effect`: the record landed as declared, then the agent stopped and asked | the receipt's scalar, the contract's `escalated_after_effect_reward` (default 0.5) |
| `escalated_after_effect`: the record landed as declared, then the agent stopped and asked | the receipt's scalar, the contract's `escalated_after_effect_reward` (0.5 in the synthetic bundle; 0 when a contract doesn't declare it) |
| `reconciliation_required` or `failed_platform` | none (a person settles it) |

The penalties are the caller's choice (`Penalties`). A write on another
Expand Down
2 changes: 1 addition & 1 deletion packages/flow/docs/REWARD_WORKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ this order.
| Signal `completed`, every required effect CONFIRMED | `verified` | the declared positive reward |
| Signal `completed`, a required effect REFUTED (absent, duplicated, wrong value) | `wrong_effect` | 0 or the declared penalty |
| Signal `halted_before_effect`, `refused`, or `rejected_policy`, store shows no required effect | that outcome | 0 or the declared penalty |
| Same signals, and every required effect is present exactly as declared | `escalated_after_effect` | `escalated_after_effect_reward` (default 0.5) |
| Same signals, and every required effect is present exactly as declared | `escalated_after_effect` | `escalated_after_effect_reward` (0 unless the contract declares it; the synthetic bundle declares 0.5) |
| Same signals, and a required effect is present but not as declared | `reconciliation_required`, uncertainty `effect_uncertain` | unscored |

Unscored is never 0.0. The receipt carries `scalar_reward: null` and the
Expand Down
8 changes: 7 additions & 1 deletion packages/flow/openadapt_flow/reward/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,13 @@ def write_bundle(
"components": [{"name": "terminal_effect", "weight": 1.0}],
# The synthetic banner lie yields 0, not the default -1 penalty:
# this fixture demonstrates "no reward", not a tuned penalty.
"scoring": {"wrong_effect_reward": 0.0},
# Asking a person after the right record landed earns half the
# verified reward. The contract declares it: an undeclared
# escalation earns nothing (openadapt-types 0.24.1).
"scoring": {
"wrong_effect_reward": 0.0,
"escalated_after_effect_reward": 0.5,
},
"certificate_policy": {
"epsilon": 0.05,
"delta": 0.05,
Expand Down
3 changes: 2 additions & 1 deletion packages/flow/openadapt_flow/reward/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def judge_episode(
* signal ``halted_before_effect`` / ``refused`` / ``rejected_policy``:
no required effect present -> that outcome; every required effect
CONFIRMED -> ``ESCALATED_AFTER_EFFECT``, the contract's partial credit
(default 0.5), because the work is done and the policy asked a person
(0 unless the contract declares it; the synthetic bundle declares
0.5), because the work is done and the policy asked a person
instead of declaring it; any other required effect present (a
duplicate or wrong write, say) -> ``RECONCILIATION_REQUIRED`` with
``effect_uncertain``, since the runtime and the store disagree and a
Expand Down
77 changes: 72 additions & 5 deletions packages/types/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,81 @@
# CHANGELOG


## v0.24.1 (2026-11-22)
## v0.24.2 (2026-11-22)

### Features
0.24.1 was stamped on main but never published. 0.24.2 is the first
published release with this content, and the version to install.

openadapt-flow 3.4.0 imports `openadapt_types.receipt`, which 0.24.0 does not
have. This release adds it and the other modules Flow imports on main
(openadapt-flow 4.0.0 will require it). It stays
within the `<0.25.0` range every released Flow 3 accepts, so upgrading this
package repairs a Flow 3.4.0 install.

- **Run receipts (`openadapt_types.receipt`, `openadapt_types.receipt_callback`).** DSSE-wrapped in-toto `record/run/v1` run receipts with signer roles, public allow-list verification, counterparty confirmations, handoff payload and item-approval bindings, RFC 8785 `report.canonical` subject digests, follow-up receipt chains (`predicate.follows`), and shared verification vectors.
- **Exception cards, run ledger, and managed jobs (`openadapt_types.exception_card`, `openadapt_types.run_ledger`, `openadapt_types.managed_job`).** Closed exception-queue card models, per-run accounting ledger schemas, and generalized managed-job contracts shared across executors and surfaces.
- **Reward partial credit (`openadapt_types.reward`).** Configurable partial-credit scoring for a confirmed write followed by an escalation ([#1824](https://github.com/OpenAdaptAI/OpenAdapt/pull/1824)).
### Features

- `openadapt_types.receipt`: the `record/run/v1` signed run receipt. It
covers building, signing and verifying the statement, the public card
(`receipt.card.json`) with only allow-listed values opened, private
openings, role keys and a key registry, counterparty confirmation lines,
and follow-up statements. Signing and verifying import `cryptography` only
when called ([#2394](https://github.com/OpenAdaptAI/OpenAdapt/pull/2394),
[#2410](https://github.com/OpenAdaptAI/OpenAdapt/pull/2410),
[#2412](https://github.com/OpenAdaptAI/OpenAdapt/pull/2412),
[#2426](https://github.com/OpenAdaptAI/OpenAdapt/pull/2426)).
- `openadapt_types.receipt_callback`: checks a managed callback's settled
report against its pinned signer and final outcome
([#2412](https://github.com/OpenAdaptAI/OpenAdapt/pull/2412)).
- `openadapt_types.run_ledger`: `openadapt.run-ledger/v1` (`RunLedgerRowV1`)
and `openadapt.agent-run-summary/v1` (`AgentRunSummaryV1`), one value-free
accounting row per run. Every string field is closed by a pattern or an
enum. The names are exported from `openadapt_types`
([#2478](https://github.com/OpenAdaptAI/OpenAdapt/pull/2478)).
- `openadapt_types.exception_card`: `openadapt.exception-card/v1` and
`openadapt.exception-answer/v1`, with seven closed kinds and five closed
answers. Import it by its submodule path; it is not exported from
`openadapt_types` ([#2494](https://github.com/OpenAdaptAI/OpenAdapt/pull/2494)).
- Reward contracts: the `escalated_after_effect` outcome, for an episode
whose required effects are all in the system of record but which asked a
person instead of declaring the task done. It earns the contract's
`escalated_after_effect_reward`: at least 0, below 1 and below its
`verified_reward`. A declared value at or above `verified_reward` is
refused, because asking would then pay as much as finishing. The default
is 0: a contract that doesn't declare it earns nothing for this outcome
([#1824](https://github.com/OpenAdaptAI/OpenAdapt/pull/1824)).
- `openadapt_types.managed_job`: domain-neutral inbox, outbox, tool result
and MCP tool contracts (`openadapt.managed-*/v1`), with four new packaged
schemas. `openadapt_types.clinic_job` stays as the compatibility module for
`openadapt.clinic-*/v1` payloads; its exception and enum names are now
aliases of the `Managed*` ones
([#2487](https://github.com/OpenAdaptAI/OpenAdapt/pull/2487)).
- Domain-neutral names beside the v1 ones: `StepClass.HIGH_RISK_WRITE`
(wire value `clinical_write`), `ApproverPolicyRefusal.HIGH_RISK_WRITE_NEEDS_OPT_IN`
and `OutcomeSourceV1.MANAGED_TOOL_STATUS`. Approval records and policies
also accept the input keys `high_risk_write`, `high_risk_write_opt_in_sha256`
and step class `high_risk_write`; plain outcome inputs accept
`managed_tool_status`, and `plain_outcome()` takes a
`managed_tool_status=` argument beside `clinic_tool_status=`. Each is
stored and written as its v1 form, so
output is byte-identical to 0.24.0. The packaged schemas, and readers
older than 0.24.2, accept only the v1 forms
([#2487](https://github.com/OpenAdaptAI/OpenAdapt/pull/2487)).

### Compatibility

- Contracts written or certified under 0.24.0 behave as before. They load
(including any positive `verified_reward`), hash to the same digest, keep
their certificates, and score every outcome 0.24.0 had the same way. The
new `escalated_after_effect` outcome earns 0 under them, since they never
declared it. A test checks this against contracts and certificates
issued by openadapt-types 0.24.0 from PyPI.
- Every 0.24.0 approval record, approver policy and identity, clinic payload
and plain outcome loads and serializes to the same bytes and digests, and
every 0.24.0 name and enum member still exists under its 0.24.0 name.
- `escalated_after_effect_reward` is serialized, and so hashed, only when it
differs from 0, so a file 0.24.2 writes for an undeclared contract is one
0.24.0 can read. A contract that declares a non-zero value can't be read
by 0.24.0, which forbids unknown fields.

## v0.24.0 (2026-10-20)

Expand Down
16 changes: 9 additions & 7 deletions packages/types/docs/REWARD.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ answer `score()` gave.
| `refused` | zero or penalty | `refused_reward` (default 0.0) |
| `rejected_policy` | zero or penalty | `rejected_policy_reward` (default 0.0) |
| `wrong_effect` | zero or penalty | `wrong_effect_reward` (default -1.0) |
| `escalated_after_effect` | partial credit | `escalated_after_effect_reward` (default 0.5) |
| `escalated_after_effect` | partial credit | `escalated_after_effect_reward` (default 0) |
| `reconciliation_required` | unscored | none |
| `failed_platform` | unscored | none |

Expand All @@ -109,17 +109,19 @@ failure this contract exists to stop.
`escalated_after_effect` is an episode where every required effect is in the
system of record exactly as declared and no forbidden effect is, but the policy
halted, refused, or was rejected instead of declaring the task done. It earns
`escalated_after_effect_reward`, default 0.5. The value must be at least 0 and
below 1, and below `verified_reward`; anything else, including NaN and
infinity, makes the contract refuse to load.
`escalated_after_effect_reward`, default 0: a contract that doesn't declare
it earns nothing for this outcome, so a contract written before the outcome
existed never starts paying for it. The value must be at least 0 and below 1,
and below `verified_reward`; anything else, including NaN and infinity, makes
the contract refuse to load.

The value sets how sure a policy has to be before it declares done rather
than asks a person. Declaring done earns `verified_reward` (v) when the effect
is right and `wrong_effect_reward` (w) when it is wrong; asking earns x. Done
pays more in expectation only when the policy's confidence p satisfies
p * v + (1 - p) * w > x, that is p > (x - w) / (v - w). With v = 1, w = -1 and
the default x = 0.5, the threshold is 75%. With x = 0 it is 50%, and with
x = 0.25 it is 62.5%. A higher x makes the policy ask more often.
p * v + (1 - p) * w > x, that is p > (x - w) / (v - w). With v = 1 and w = -1,
the default x = 0 gives a threshold of 50%, x = 0.25 gives 62.5%, and x = 0.5
gives 75%. A higher x makes the policy ask more often.

An effect that is present but not as declared (a duplicate or a wrong value)
after the policy stopped is still `reconciliation_required` and unscored, and a
Expand Down
17 changes: 10 additions & 7 deletions packages/types/openadapt_types/approval.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,13 @@ class StepClass(str, Enum):
REVERSIBLE = "reversible"
CONSEQUENTIAL = "consequential"
IRREVERSIBLE = "irreversible"
#: An irreversible, high-risk write to a system of record.
#: Wire value remains ``clinical_write`` in v1 for signed-grant and receipt compatibility.
HIGH_RISK_WRITE = "clinical_write"
#: Legacy alias for ``HIGH_RISK_WRITE``.
#: An irreversible, high-risk write to a system of record. Declared
#: first so the member keeps its 0.24.0 name (``.name``, ``str()``,
#: ``repr()``); the wire value stays ``clinical_write`` in v1 for
#: signed-grant and receipt compatibility.
CLINICAL_WRITE = "clinical_write"
#: Domain-neutral alias for ``CLINICAL_WRITE``.
HIGH_RISK_WRITE = "clinical_write"

@classmethod
def _missing_(cls, value: object) -> Optional["StepClass"]:
Expand All @@ -305,10 +307,11 @@ class ApproverPolicyRefusal(str, Enum):
"""Closed reasons a policy refuses an approver."""

KIND_NOT_ALLOWED = "approver_kind_not_allowed"
#: Wire value remains ``clinical_write_needs_opt_in`` in v1 for Flow compatibility.
HIGH_RISK_WRITE_NEEDS_OPT_IN = "clinical_write_needs_opt_in"
#: Legacy alias for ``HIGH_RISK_WRITE_NEEDS_OPT_IN``.
#: Declared first so the member keeps its 0.24.0 name; the wire value
#: stays ``clinical_write_needs_opt_in`` in v1 for Flow compatibility.
CLINICAL_WRITE_NEEDS_OPT_IN = "clinical_write_needs_opt_in"
#: Domain-neutral alias for ``CLINICAL_WRITE_NEEDS_OPT_IN``.
HIGH_RISK_WRITE_NEEDS_OPT_IN = "clinical_write_needs_opt_in"

@classmethod
def _missing_(cls, value: object) -> Optional["ApproverPolicyRefusal"]:
Expand Down
7 changes: 4 additions & 3 deletions packages/types/openadapt_types/plain_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,11 @@ class OutcomeSourceV1(str, Enum):
EXECUTION_OUTCOME = "execution_outcome"
AGENT_STATUS = "agent_status"
CONNECTOR_STATUS = "connector_status"
#: Domain-neutral alias; v1 wire key remains ``clinic_tool_status`` for
#: compatibility with deployed v1 readers and schemas.
MANAGED_TOOL_STATUS = "clinic_tool_status"
#: Declared first so the member keeps its 0.24.0 name; the v1 wire key
#: stays ``clinic_tool_status`` for deployed v1 readers and schemas.
CLINIC_TOOL_STATUS = "clinic_tool_status"
#: Domain-neutral alias for ``CLINIC_TOOL_STATUS``.
MANAGED_TOOL_STATUS = "clinic_tool_status"
PROGRAM_TERMINAL_STATE = "program_terminal_state"
OVERLAY_PHASE = "overlay_phase"

Expand Down
Loading
Loading