Repository navigation
refactor(flow): generalize Execute seeding, reward bundles, and identity chrome - #2486
Conversation
Independent adversarial review: REQUEST CHANGESFrom: Codex
The Execute and reward findings come from source review. The identity result comes from a local synthetic verifier check. The submitted ERP test exercises the helper in isolation. The reduction from 301 to 248 counts scanner matches and does not establish runtime behavior. |
…y, and reward defaults
Independent adversarial review: REQUEST CHANGESFrom: Codex The template writer and reader disagree on sibling-derived headings. With a synthetic band containing a distinct record name, shared invoice headings and a date, plaintext verification returned The standard compiler and replay still omit sibling evidence. The principal template builder call and the plaintext replay call both use the empty default. The synthetic ERP heading-only band abstained in both public verifiers when supplied sibling rows and verified in both when those rows were omitted. Connect available sibling evidence at the ordinary caller, or describe this as an opt-in API and narrow the runtime claim. The restored vocabulary does preserve abstention on the original heading-only regression without sibling data. Compiler · Replay The other three findings are resolved in source. A non-synthetic admission without a bundle now fails before effects. A desktop worker default preserves the existing web tutorial route, while an explicit admission deployment still gets its surface check. Both reward demo tiers now pass their clinical effects, identity keys and IDs explicitly. Dispatch · Mixed-worker routing · Reward seed I ran the identity controls against the exact-head implementation and data models. The Execute and reward conclusions come from their changed source, callers and test assertions. |
Independent adversarial review: REQUEST CHANGESFrom: Codex P2. An existing template can change verdict even when no sibling evidence is supplied. I compiled a synthetic matching band with a lowercase entity name and a date on the previous head and this head using the same salt and default arguments. The serialized templates were byte-identical and passed metadata validation in both revisions. Replaying that stored template returned The changed template reader uses The previous opt-in blocker is closed. With sibling rows supplied, both exact-head verifiers verified the matching distinct record, reported a mismatch for the other record and abstained on shared headings alone. In all three cases the template passed metadata validation. The opt-in API scope is documented. The three earlier Execute and reward findings remain resolved. Scope · Exact-head CI |
…ercase template parity
Independent adversarial review: REQUEST CHANGESFrom: Codex The new reader resolves the previous lowercase-name finding in source. A stored template without P2. Empty sibling metadata changes serialized templates on supported Pydantic versions. Flow declares Pydantic ≥2.5. In 2.11.2, CI also blocks this head. The smoke job stopped at the file-size check before installing packages. It measured 6,838 lines in |
Independent adversarial review: REQUEST CHANGESFrom: Codex The file-size finding is resolved. I counted 6,822 lines in The legacy serialization finding remains. On supported Pydantic 2.11.2, |
…erge main (199 baseline hits)
Independent adversarial review: APPROVEFrom: Grok Delta versus the prior Codex REQUEST CHANGES at The remaining serialization finding is addressed. The serve-execute conflict resolution is behavior-equivalent: This source review traced the wrap serializer, the conflict hunks, and the ratchet/baseline numbers. I did not rerun suites or the generality script. |
Independent adversarial review: APPROVEFrom: Grok Delta versus my prior APPROVE at I reviewed only this merge delta, not the already-reviewed unique work or the already-merged main trees. I did not rerun CI. |
- The Flow 3.5.0 notes use the openadapt-flow spellings. The launcher's hooks, proxy, plan, handoff and flight commands are on main, not in launcher 1.23.0. The breaking-changes list now names every rename in #2486 and says openadapt-eligibility is not on PyPI yet. - The openadapt-types 0.24.1 notes say the reward contract digest changes for every contract. - CAPABILITIES.md marks the handoff list, follow-up receipt and plan rows as shipping too, and names the spelling that works on PyPI. - The floor check tells a missing tag from an unanswered query: it asks origin with ls-remote and fails closed when it can't, or when fetching a tag origin has fails.
…ypes 0.24.1 Flow's removals (openadapt_flow.eligibility) and renames (#2486) are breaking, so this is Flow 4.0.0, not 3.5.0. The notes gain an "Upgrading from 3.x" section with the eligibility install and import change, the seed_admissions replacement for seed_mockmed, the synthetic_runner rename and the new reward bundle default ids. An identity-words change the PR description named never reached main, so it is not listed. openadapt-agent 2.3.0 widens its Flow requirement to <5. The launcher requires openadapt-agent<3, and agent 2.2.2 caps Flow below 4, so without it `pip install openadapt` could not resolve Flow 4.0.0. Its version moves in pyproject, manifest.json, server.json and openadapt_flow.agent, which the agent shim reports. The eligibility connector now requires Flow 4. openadapt-types 0.24.1 keeps every 0.24.0 digest. escalated_after_effect_reward enters RewardContractV1.digest only when it differs from its default, and the pinned contract digest is back to its 0.24.0 value. A fixture of contracts and certificates issued by openadapt-types 0.24.0 from PyPI checks that they hash and verify unchanged. A 0.24.0 contract with verified_reward of 0.5 or less still loads: left at the default, an escalation then earns no credit, so asking never pays as much as finishing. A declared value at or above verified_reward is still refused.
Summary
Burns down 53 engine-generality baseline hits in
openadapt_flow/(301 -> 248) by removing MockMed and healthcare/app-specific coupling from core engine modules:execute/registry.py,service.py,app.py,dispatch.py— 37 hits -> 0):seed_mockmed: boolwith caller-suppliedseed_admissions: Iterable[AdmittedBundle]inExecuteService,create_app,serve, andseed_admissions()inexecute/registry.py.execute/registry.pyintoopenadapt_flow/mockmed/execute_seed.py;--seed-mockmedin__main__.pynow passesdemo_admissions()as data.synthetic_mockmed->synthetic_runnerwith domain-neutral evidence tags (synthetic-verified/synthetic-banner-lie).live_replayso any bundle with an explicitdeploymentconfig (including web bundles) runs through_surface_replay; demo fallback delegates totutorial.run_demo_workflow_replay.reward/bundle.py— 3 hits -> 0):SYNTHETIC_TASK_ID,SYNTHETIC_ENVIRONMENT_ID,DEFAULT_CERTIFICATE_ID) with domain-neutral defaults and explicittask_id/environment_id/certificate_idparameters;reward/seed.pypasses its demo IDs explicitly.runtime/identity.py— 1 hit -> 0 + D14 fix):patient,chart,charts,discharged,admitted,appointment,demo) from_GENERIC_IDENTITY_WORDS, keeping only domain-neutral status/UI words.derive_sibling_chrome_words(rows, min_fraction=0.5)to derive repeated non-identifying row chrome from sibling rows across any domain.report_redaction.py,runtime/actuators/web_form.py,ensure_record.py,rollback_state.py,compile_agent/code_action.py,ir.py— 12 hits -> 0):scripts/generality_baseline.json):python3 scripts/check_engine_generality.py --update-baseline.Generality Gate
execute/,reward/bundle.py,runtime/identity.py,runtime/actuators/web_form.py,report_redaction.py,ensure_record.py,rollback_state.py,compile_agent/code_action.py, andir.pynow have zero app-specific hits underscripts/check_engine_generality.py. Demo seed data lives inmockmed/execute_seed.pyandreward/seed.pyand is passed into the engine as data.seed_mockmed) with data-drivenseed_admissionsacrossregistry.py/service.py/app.py, parameterizedwrite_bundleIDs acrossreward/bundle.py, and added data-drivenderive_sibling_chrome_words()instead of hand-maintained domain word lists.test_generic_seed_admissions_writes_non_demo_bundlewith an ERP invoice admission andTestSiblingChromeDerivation.test_derive_sibling_chrome_words_across_domainson ERP invoice rows). Live multi-app replay on held-out web targets has not yet been re-run for this PR.Verification
python3 scripts/check_engine_generality.py->Engine generality OK (248 baseline hits left)(down from 301)python3 scripts/check_release_consistency.py->Release version 3.4.0 is synchronized across project, module, and lock.ruff check&ruff format --check-> clean across all modified filesmypy->Success: no issues found in 12 source filespytest(12 targeted test suites:test_execute_ref,test_execute_post_dispatch_faults,test_execute_dispatch_mapping,test_jit_draft_execution,test_backend_parity_refusals,test_reward_worker,test_reward_trust_boundary,test_identity,test_identity_evidence,test_report_redaction,test_probe_induction,test_undo_proposal) -> 940 passed, 0 failed