Repository navigation
refactor(generality): ratchet engine baseline 199 -> 7 and guard all 4 core packages - #2537
Conversation
Independent adversarial review: APPROVEFrom: Grok Cross-vendor review of this Gemini-authored PR. I did not write these changes. One commit versus current What landed
No CI or safety weakening. No new per-app logic in the engine path. Residuals (not blockers of this PR's own content)
No merge from this review. |
Independent adversarial review: APPROVEFrom: Grok Delta confirmation versus my APPROVE at First-parent delta is two commits:
No unique behavioral change, no CI/safety weakening, no new engine app-name hits. I did not re-litigate the previously approved unique body (including the earlier five-term No merge from this review. |
Summary
Burns down the
openadapt_flow/engine-generality baseline from 199 -> 7 (-192hits, 96.5% reduction) and extendsscripts/check_engine_generality.pyto guard all 4 core packages (packages/flow,packages/types,packages/desktop,packages/capture) against app-specific leaks:reward/seed.py->mockmed/reward_seed.py,-34hits):seed_mockmed,MOCKMED_*) out ofopenadapt_flow/reward/intoopenadapt_flow/mockmed/reward_seed.py(preserving git rename history) and updated the 3 internal callers (tutorial.py,test_reward_worker.py,test_reward_trust_boundary.py).generality.toml,tutorial.py,__main__.py,-62hits):mockloan/togenerality.toml[allow.terms_in]alongsidemockmed/.__main__.py's bundled demo server/seeding imports throughtutorial.py(serve_demo_app,demo_execute_admissions,seed_demo_reward) and reworded demo help/docstrings, leaving only the 6--seed-mockmedCLI flag compatibility lines in__main__.pyand the 1 explicitly documented legacy hash shim (LEGACY_HASHED_DEFAULTSindeployment.py).runtime/effects/*,compiler/*,backends/*,validation/dense_surface.py,generate/*,jit/*,risk.py,volatility.py, etc. —-96hits):dense_surface.py's synthetic table header (0hits across all 45+ engine modules outside__main__.pyanddeployment.py).scripts/check_engine_generality.py,packages/desktop/openadapt_desktop/{cli.py,targets.py}):MockMedreferences inpackages/desktop/openadapt_desktop/.scan_core_packages()tocheck_engine_generality.pyenforcing 0 allowed hits foropenemr,medplum,mockmed,stedi, andopenimisacrosspackages/types/openadapt_types,packages/desktop/openadapt_desktop, andpackages/capture/openadapt_capture(with unit tests intests/test_engine_generality_check.py).Generality Gate
openadapt_flow/is down to 7 compatibility-only baseline hits (6--seed-mockmedCLI flag lines in__main__.py+ 1 legacy hash-compat shim indeployment.py), andpackages/types,packages/desktop, andpackages/captureare all at 0 hits.check_engine_generality.pynow guards all 4 core packages (flow,types,desktop,capture) in CI so app-specific references cannot creep back into any core package.test_core_packages_guard_catches_app_namesandtest_monorepo_core_packages_have_zero_app_leaksagainst synthetic leaks intypes,desktop, andcapture, plus the real monorepo tree. No live external-app replay was needed for this static/structural cleanup.Verification
python3 scripts/check_engine_generality.py->Engine generality OK (7 baseline hits left)(down from 199)python3 scripts/check_file_size_ratchet.py-> PASS (__main__.py: 14317 <= 14331,ir.py: 6822 <= 6830)python3 scripts/check_release_consistency.py->Release version 3.4.0 is synchronized across project, module, and lock.ruff format --check-> 55 modified Python files formatted cleanlymypy(mockmed/reward_seed.py,reward/bundle.py,tutorial.py,validation/dense_surface.py) ->Success: no issues found in 4 source filespytest(7 targeted suites:test_engine_generality_check,test_reward_worker,test_reward_trust_boundary,test_execute_ref,test_policy,test_probe_induction,test_undo_proposal) -> 180 passed, 0 failed