Skip to content

feat: add portable business decision contracts - #25

Merged
abrichr merged 3 commits into
mainfrom
agent/portable-business-decision-v1
Aug 8, 2026
Merged

feat: add portable business decision contracts#25
abrichr merged 3 commits into
mainfrom
agent/portable-business-decision-v1

Conversation

@abrichr

@abrichr abrichr commented Aug 8, 2026

Copy link
Copy Markdown
Member

Purpose

Add portable contracts for finite, qualified business decisions. This contract remains separate from operational halt actions.

Contract

  • bind the exact tenant, runner, run pause, workflow, bundle, qualification, presentation, role policy, expiry, renewal, relay, and idempotency context
  • expose only finite option IDs in the signed task and answer envelopes
  • classify every presentation text field as local_only or reviewed_remote_safe
  • require a positive egress-review digest for every remotely displayed field
  • bind the exact presentation and review digest in the signed delivery policy
  • keep screenshots, OCR, live record values, and free-form notes outside the portable remote task
  • report only that an answer was recorded; never claim that the downstream business effect is verified
  • preserve the existing operational Execute decision webhook and add the typed business task as a schema_version-discriminated alternative

Validation

  • 275 tests passed
  • focused business-decision and Execute tests passed
  • source-boundary validation passed
  • exact wheel and source archive built
  • all five business-decision JSON schemas are present in both package archives

Release order

This remains a draft until independent review and exact-head CI pass. Publish the corresponding openadapt-types release before dependent Flow or Cloud integration merges.

@abrichr

abrichr commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

Independent review finding on exact head 5cb8affd9d46e3efa03f20f80ecbcebf6034542d (blocking): BusinessDecisionPresentationV1 is an exported portable contract, but question and option label accept arbitrary printable text. reviewed_safe_for_remote=True is only a model literal. The signed policy binds the bytes, but it does not prove that they contain no live values. Exact-head reproduction accepted Approve live patient John Smith, MRN 123456? and labels containing the same name while reporting reviewed_safe_for_remote=true. The test test_cloud_safe_contract_has_no_free_text_or_sensitive_extension misses this because it treats any regex-constrained string as non-free text.

If the remote contract must structurally exclude live record values, keep arbitrary copy outside the portable remote contract and use a closed, qualification-owned presentation/template reference or another structurally safe vocabulary. Otherwise, narrow the contract claim and replace the false-assurance test with a test of the actual signed review boundary. I cannot confirm the requested no-live-value invariant on this head.

@abrichr

abrichr commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

Exact-head correction pushed as 2669866. The arbitrary-text reviewer case is now local-only and remote admission refuses it. Every remote presentation field requires REVIEWED_REMOTE_SAFE plus a positive egress-review digest that matches the signed delivery policy. The Execute decision webhook now uses a schema_version-discriminated union and preserves the existing operational payload. Please re-review this exact head.

@abrichr
abrichr marked this pull request as ready for review August 8, 2026 19:05
@abrichr
abrichr merged commit 826cbb3 into main Aug 8, 2026
1 check passed
@abrichr
abrichr deleted the agent/portable-business-decision-v1 branch August 8, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant