Repository navigation
test: Flow layers import downward only, with import-time budgets for low modules - #2427
Conversation
Independent adversarial review: APPROVEFrom: Grok First review of this PR. Author is GitHub The layer assignment is sound for a first wave. A subprocess Leaving 334 unlayered modules (of 763) unchecked is acceptable for this first step, and is documented. New upward edges among unlayered modules are not caught. A later pin of the unlayered count would stop that set from growing silently; I am not asking for it in this PR. The debt list of 78 upward edges can only shrink, which is the right rule. I am not merging. |
Independent adversarial review: APPROVEFrom: Grok Delta review after my APPROVE at The only unique change is one line: |
|
I merged
The new head is |
Independent adversarial review: APPROVEFrom: Grok Re-review at the current head (moved since The budgets now match the post-B1/B2 sizes: No merge from me. |
This is safety-net step A3 of the approved monorepo refactor plan (openadapt-internal#277, section 3.1). It adds a test and contract data, and changes no runtime code.
Layers
import_layers.jsongains five layers, lowest first:ir,crypto,ed25519ph,private_file,at_rest,verification,check_level,runtime.effects.effectapproval_mode,policy,run_gate,deployment,runtime.authorization,qualification*, receipts and Sealsruntime,backends,backend,verifier,verify_run,verifycompiler,repair,generate,tx,form_tx,wrap,agent,jit,qualify,fleet,runner,connector__main__,cli_*,console,servicesA module may import its own layer or a lower one.
The new test
tests/test_import_direction.pychecks four things:import_direction_debt.json. A listed edge that disappears also fails, so the list only shrinks.openadapt_flowmodules loaded. Today's numbers are the budgets:openadapt_flow51,ir51,verification51,crypto52,receipt52,offline_seal52,public_seal53,write_receipt54. Going over budget fails. Going under prints the number to lower the budget to. The B-track PRs will lower these.334 modules match no layer yet and are not checked. They get layers as code moves.
test_import_layers.pyis unchanged, and all 2,218 of its tests pass.Collisions
I ran the test on
git merge-treeresults of this branch with each of these PR heads: #2394, #2410, #2414, #2415, #2411, #2406, #2407, #2412, #2300, #2401, #2375, #2413, #2405 and #2403. All pass.Exceptions:
import openadapt_flowloads (52 against a budget of 51). Either merge this PR after feat(flow): wait for a person at a sign-in's second factor #2363 and set the budgets from that tree, or feat(flow): wait for a person at a sign-in's second factor #2363 makes that import lazy.Tested locally on Python 3.12 with ruff clean.