Skip to content

refactor(flow): move the qualification data model to qualification/models.py, re-exported unchanged - #2454

Merged
abrichr merged 4 commits into
mainfrom
refactor/qualification-models-module
Nov 21, 2026
Merged

abrichr merged 4 commits into
mainfrom
refactor/qualification-models-module

Conversation

@abrichr

@abrichr abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member

This is the first qualification step (F1) of the approved monorepo refactor plan, openadapt-internal#277 (track F). It builds on B2 (#2439) and the verify_moved_code.py fix (#2431), both now merged, and removes no functionality.

What moves

openadapt_flow/qualification.py becomes a package:

  • qualification/models.py (1,169 lines). This is the data model, moved unchanged: 42 constants, enums, Pydantic models and the helpers they use, ending just before class QualificationError. Nothing in it depends on the rest of the module.
  • qualification/__init__.py (4,891 lines). This keeps everything else. It re-exports all 42 names, and keeps every import the module had. Imports the remaining code no longer uses are kept with # noqa: F401, so no attribute disappears.

Proof that nothing was removed or edited

  • Move check. scripts/verify_moved_code.py --base origin/main reports 346 moved units, no edited or new function bodies, and no test patch to retarget.
  • Attributes. Comparing vars(openadapt_flow.qualification) before and after: nothing lost, and only models gained.
  • New test. tests/test_qualification_package.py checks that each of the 42 moved names is the same object through the old path. It also checks that the old imports work, that ir still resolves Workflow.qualification to the same class, and that models.py doesn't import the package.
  • Existing tests. test_import_surface.py passes. Its regeneration now counts a package's re-exports from its own submodules, so regenerating keeps the moved names. test_import_layers.py passes (2,218 tests), after moving the one debt row to the new path and rebinding the reviewed baseline hash (merged with main's four B1 rows).
  • Strict mypy passes on openadapt_flow/qualification/. The safety-path mypy step now lists the package directory.

Paths updated

Collisions

No open PR edits qualification.py. git merge-tree against the heads of #2394, #2410, #2414, #2415, #2411, #2406, #2407, #2412, #2300, #2398, #2382, #2314, #2363 and #2401 adds no conflict. Every conflict listed there already exists against main. The new tests from #2421, #2422, #2424 and #2427 pass on this branch merged with each of them.

Full flow suite (local, Python 3.12): 24,576 passed, 114 failed, 12 errors. Every one of those failures also fails on the base commit 12713d970 in this environment: missing mcp extra, CDP and Playwright browser tests, the capture recorder, and the serial tx_acid speed case. The two files that hang in this environment (test_capture_preflight.py and e2e/test_video_capture.py) were left out of both runs.

@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: a58291f

Unique work versus main: the qualification data model (42 top-level constants, enums, models and helpers) moves from qualification.py into qualification/models.py, and the package re-exports each name.

I compared those 42 definitions to the pre-split qualification.py; their ASTs are identical, and qualification/__init__.py imports all 42, so from openadapt_flow.qualification import X is the same object as qualification.models.X. The new tests pin that identity, keep a couple of old import paths working, and check that models.py does not import the rest of the qualification package. The later unique commits rebind the import-layer debt baseline to the moved path and record the package __init__.py budget at its real size. I do not see a behavior change or a weakened safety check.

No merge from me.

@abrichr
abrichr merged commit 947cc94 into main Nov 21, 2026
101 of 106 checks passed
@abrichr
abrichr deleted the refactor/qualification-models-module branch November 21, 2026 13:06
yunusarda-sudo pushed a commit to yunusarda-sudo/OpenAdapt that referenced this pull request Nov 22, 2026
….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).
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