Repository navigation
refactor(flow): move the replayer's qualification fault injection to a mixin, unchanged - #2456
Conversation
…eplay/_shared.py, re-exported unchanged
…a mixin, unchanged
Independent adversarial review: APPROVEFrom: Grok Unique work versus #2455 ( I compared those ten methods to the pre-move No merge from me. |
Independent adversarial review: APPROVEFrom: Grok Re-review at the current head (moved since The ten mixin methods and No merge from me. |
|
From: Claude |
….1.4 Keep OpenAdaptAI#2375's amendment of the OpenAdaptAI#2341 note and this branch's notes side by side, note the Flow merges since (OpenAdaptAI#2383, OpenAdaptAI#2439, OpenAdaptAI#2451, OpenAdaptAI#2454-OpenAdaptAI#2456, OpenAdaptAI#2459), and relock packages/flow on openadapt-privacy 1.1.4 (was 1.0.0).
Step E2 of the approved monorepo refactor plan (openadapt-internal#277, track E; DECOMPOSITION.md section 4.4, step 2). It moves code only. Stacked on E1 (#2455, approved): only the last commit is new.
The replayer's qualification fault injection moves unchanged into
openadapt_flow/runtime/replay/qualification_faults.pyas theQualificationFaultInjectionmixin, andReplayerinherits from it. These are the 10 methods:_qualification_fault_gate_for_kind_qualification_fault_context_require_current_fault_driver_binding_validate_fault_mutation_apply_screen_fault_mutation_bind_surface_qualification_environment_is_qualification_fault_step_qualification_id_sha256_observe_qualification_environment_require_qualification_environment_currentHow it was generated. I used
scripts/extract_mixin.py, the tool from the October decomposition branchrefactor/runtime-core(DECOMPOSITION.md section 4.1). For mypy only, a host class declares exactly the attributes and methods the moved code reads fromself. At run time, the method resolution order isReplayer, then the mixin, thenobject. Methods are still looked up on the instance, so tests that call or replace private methods keep working.Nothing removed.
replayer.pykeeps every import it had. The three names only the moved code used (QualificationFaultContext,QualificationFaultKind,verify_fault_mutation_receipt) stay importable from it, markednoqa.replayer.pygoes from 19,654 to 19,325 lines, and its budget is lowered to match.Checks I ran.
verify_moved_code.pyagainst E1: 10 moved units, no edits, no patch to retarget. The only class header that changed isReplayer(QualificationFaultInjection).replayer.pyandruntime/replay/.test_import_surface.py(all 278Replayermethods),test_import_layers.py,test_fresh_imports.pyand the qualification-fault tests pass: 2,320 tests.Collisions. No open PR edits these methods. The
replayer.pyhunks that open PRs touch are in_settle_pipelined_readback(#2412),_act_without_dialog(#2363, #2368) and_approval_form_state(#2291).