Repository navigation
test: pin the JSON schema of every model in ir and the qualification modules - #2424
Conversation
Independent adversarial review: REQUEST CHANGESFrom: Grok First review of this PR. Author is GitHub The validation and serialization schemas, compared with The listed modules match the stated first wave (ir, qualification*, admission envelopes, The regenerate path will drop every moved model. On a different Pydantic version the test still requires every pinned name to resolve, which is the right fallback. I am not merging. |
Independent adversarial review: APPROVEFrom: Grok Delta review after my REQUEST CHANGES at Regeneration now unions |
…d budgets Review blocker (fail-open class: unbounded-read-as-evidence): a file source that is a FIFO, a device or a link to one could block the open or never reach EOF and hang the run. A file source is now read only when it is a regular file: it is checked before the open, opened with O_NONBLOCK, and fstat-checked after. Anything else is unreadable, as is a file over 256 MiB (also while it grows during the read). Tests cover a FIFO, a link to it, /dev/null and the size cap. CI: deployment imported up into runtime.effects.local_state, and the eager runtime.effects export loaded one more module for ir and receipt than their budgets allow. The typed source models move to openadapt_flow/local_state_sources.py (policy layer, and added to the protected-path manifest beside runtime/effects/**). The verifier is a lazy export of openadapt_flow.runtime, like Replayer. local_state reads sys.platform without binding the sys namespace, so the lazy export is no new import-layer debt site. No budget or debt row changed. The deployment schema snapshot is regenerated on Pydantic 2.13.4 for the new effects.local_state field (#2424).
This is the schema-snapshot step of the safety net in the approved monorepo refactor plan (openadapt-internal#277, section 5, item 4). It adds tests only.
packages/flow/tests/test_schema_surface.pypins the JSON schema of every Pydantic model defined in the modules the plan moves first:ir(99 models)qualification(15)qualification_*.pymodulesproduction_qualificationapproval_mode.modelrecords.schemaruntime.effects.effectThat is 178 models in 16 modules.
What it pins:
model_json_schema.packages/flow/uv.lock). On another version, the test checks only that every model name still resolves.fixtures/schema_surface/. A PR that changes models in one module touches one file.Left out on purpose:
qualify/, because Qualify workflows through owned Windows and RDP sessions #2018 and Qualify native Windows saves with observed faults and complete record checks #2301 are changing it.Collisions: I merged this branch with the heads of #2394, #2410, #2414, #2415, #2411, #2406, #2407, #2412, #2300 and #2291 (
git merge-tree) and ran the test on each result. All pass. #2363 changesirmodels (the second-factor wait), so it will need to regenerateopenadapt_flow.ir.jsonafter this merges:Tested: passes locally on Python 3.12, including under
env -iwith a differentHOME. ruff is clean.