Repository navigation
refactor(types,desktop): generalize healthcare/clinic core contracts and policies - #2487
Conversation
Independent adversarial review: REQUEST CHANGESFrom: Codex
Evidence covers immutable source, synthetic serialized artifacts and the existing hosted run. No live app, signing or dispatch was exercised. |
…schema, and support bundled Flow policy fallback
Independent adversarial review: REQUEST CHANGESFrom: Codex Three findings from the previous review still affect ordinary readers or commands.
Resolved. The exact Flow mirror test passes. Base-generated person-only and opt-in policies, plus approved and declined records, retained identical canonical v1 bytes through both Types readers and validated against both shipped schemas. Flow's policy digests matched, and its normal unsigned-policy loader retained the delegation refusal. These checks used immutable source and synthetic unsigned inputs. Hosted CI for this revision is pending. Current run |
…catalog slots, and canonical v1 outcome bytes
Independent adversarial review: REQUEST CHANGESFrom: Codex One Desktop policy-selection regression remains. An operator can explicitly request the stricter Preserve the distinction between an omitted policy and an explicit selection through the dispatcher. A request to reuse the recorded policy can retain the old identity. An explicit selection should evaluate that policy or return a clear error. A focused regression can assert which policy reaches the evaluator for both requests on the same previously permissive bundle. The other cases from the previous review are resolved. The qualification screen forwards the inspected policy, including the legacy The policy finding comes from tracing the exact dispatcher and certification source. The serialization and catalog checks used synthetic inputs. Hosted CI is pending. Current run |
…ispatcher and qualification
Independent adversarial review: REQUEST CHANGESFrom: Codex Desktop still sends a policy selection when the user simply opens an existing bundle. The dispatcher now preserves an omitted policy and honors an explicit Omit the initial UI policy argument when the user has made no selection. Carry the policy returned by inspection through subsequent certification actions, including Check it's shared request helper. Keep the new backend behavior for a caller who expressly selects a policy. The existing regression invokes the dispatcher directly and does not cover the field the screens insert. Check it helper · Dispatcher regression This finding follows the exact request literals, dispatcher branches and certificate comparison. I did not run a certification. Hosted CI is queued. Current run |
…olicy on certification
Independent adversarial review: APPROVEFrom: Codex The remaining UI finding is resolved. Both Qualification and Check it now send only the workflow ID on initial inspection. The dispatcher therefore receives an omitted policy and can reuse the bundle's recorded policy. Both screens carry the inspected value into certification. The lifecycle screen carries it into its follow-up requests, and an explicitly supplied value in the shared request helper takes precedence. Qualification inspection · Qualification certification · Check it request helper The new Check it component test renders the screen, clicks approval and asserts the exact IPC arguments: the initial inspection omits |
Independent adversarial review: APPROVEFrom: Grok Delta confirmation versus Codex APPROVE at Delta
I did not re-litigate the previously approved unique body. The unique tree at Merge-order residual (not a blocker of this PR's own content)#2532 (#2532, currently No merge from this review. |
…y-types-desktop # Conflicts: # packages/desktop/CHANGELOG.md
Independent adversarial review: APPROVEFrom: Grok Delta confirmation versus my APPROVE at DeltaFirst-parent delta is two commits:
This also clears the earlier merge-order residual against #2532 / #2533: this head no longer ships 0.31.1. I did not re-litigate the previously approved unique body. No merge from this review. |
….1 notes #2487 declared the domain-neutral alias before the v1 member in StepClass, ApproverPolicyRefusal and OutcomeSourceV1, so .name, str() and repr() of the v1 member changed (StepClass.CLINICAL_WRITE.name became HIGH_RISK_WRITE). The v1 member now comes first and the new name is the alias, as in 0.24.0. Values, wire bytes and schemas are unchanged. The 0.24.1 notes now list #2487: the managed_job module and schemas, the domain-neutral aliases and accepted input forms, and that output stays byte-identical to 0.24.0.
Summary
Generalizes healthcare/clinic/insurance concepts in
packages/typesandpackages/desktopto domain-neutral core contracts and policies, keeping narrow backward-compatible wire shims only where serialized receipts or configs require compatibility.packages/typesopenadapt_types/managed_job.py): Introduced domain-neutralManagedInboxV1,ManagedOutboxV1,ManagedToolResultV1,ManagedMcpToolCatalogV1,ManagedBoundToolCallV1,ManagedToolStatusV1, andopenadapt.managed-*/v1schemas (subject_token,collect,attach_artifact,create_task) exported viascripts/export_managed_job_schemas.py.openadapt_types/clinic_job.py): Marked as a legacy compatibility shim for existingopenadapt.clinic-*/v1wire payloads, reusingManagedToolStatusV1,ManagedActuationDecisionV1,ManagedActuationHeld, andManagedToolUnknown.openadapt_types/approval.py): GeneralizedStepClass.CLINICAL_WRITE->StepClass.HIGH_RISK_WRITE(high_risk_write),ApproverPolicyRefusal.CLINICAL_WRITE_NEEDS_OPT_IN->HIGH_RISK_WRITE_NEEDS_OPT_IN, andclinical_write_opt_in_sha256->high_risk_write_opt_in_sha256, with wire-level deserialization shims and legacy aliases for previously serialized policies/receipts. Re-exported JSON schemas.openadapt_types/vocabulary/outcomes.json,outcome-vectors.json,plain_results.py,docs/VOCABULARY.md): Generalizedclinic_tool_status->managed_tool_statuswith backward-compatible input handling inplain_outcome()andPlainOutcomeInputsV1.packages/desktopPOLICY/DEFAULT_QUALIFICATION_POLICYfrom"clinical-write"to Flow's domain-neutral"record-write"inopenadapt_desktop/check_setup.py,openadapt_desktop/qualification.py,src/screens/CheckIt.tsx,src/screens/Qualification.tsx, andsrc/screens/QualificationLifecycle.tsx.dos,mrn,npi,icd,cpt) insrc/screens/NeedsYou.tsxandsrc/lib/outcomes.tswith general system-of-record acronyms (id,url,api,sku,po,dob,ssn,ein,zip); generalized healthcare/clinic wording insrc/screens/Welcome.tsx,src/screens/Sample.tsx,src/ui/ApprovalSwitch.tsx,openadapt_desktop/approval_mode.py,openadapt_desktop/config.py, andopenadapt_desktop/portal/ingress.py.Generality Gate
packages/typesandpackages/desktop, replacing them with domain-neutral contracts (managed_job,high_risk_write,managed_tool_status,record-write).packages/typestest suite (820 tests, including new domain-neutral contract and legacy-compat tests) and targetedpackages/desktopengine/portal tests (112 tests).Verification
packages/types:uv run ruff check openadapt_types tests scripts,uv run ruff format --checkon new files,uv run mypy --follow-imports=silent openadapt_types/managed_job.py openadapt_types/approval.py,uv run pytest -q(820 passed)packages/desktop:uv run ruff checkon edited modules,uv run pytest -q tests/test_engine/test_check_setup.py tests/test_engine/test_approval_mode.py tests/test_engine/test_qualification.py tests/test_engine/test_check_it_drills.py tests/test_portal/test_ingress.py tests/test_oracle_vocabulary.py(112 passed)