Parent sprint: #87
Depends on: #88, #89, #90, #91, #92, #93, #94
Recommended order: 9
Codex-ready: yes
Goal
Add contract tests proving that indexed inventory can actually satisfy current lvl1 route-selection and assembly-input discovery logic.
Background
BuildCompiler.assembly_lvl1() depends on several pieces lining up correctly:
_extract_design_parts(...) extracts the ordered design components;
_construct_plasmid_dict(...) finds indexed part plasmids;
_get_backbone(...) chooses a compatible backbone;
get_compatible_plasmids(...) validates fusion-site compatibility;
- BsaI and ligase implementations are present;
Assembly(...) receives well-formed Plasmid objects.
When this fails today, the error may not clearly distinguish indexing failure, selector failure, missing reagent, missing backbone, or assembly failure.
Scope
Add tests that start from local fixture documents and stop before or at lvl1 assembly input creation. Suggested coverage:
- complete local fixture resolves all required design parts;
- each required part maps to at least one indexed plasmid;
- compatible backbone is selected deterministically;
- missing part fixture reports which design part cannot be satisfied;
- missing backbone fixture reports no compatible backbone;
- missing BsaI/ligase fixture reports missing reagent clearly;
_get_backbone() does not silently return (None, None) without a useful diagnostic.
Non-goals
Acceptance criteria
Verification
pytest -k "lvl1 and route"
pytest -k "backbone or compatible or plasmid_dict"
ruff check .
Codex implementation notes
- Prefer tests around existing private helpers if public API is not ready yet.
- If helper behavior is currently too implicit, add small diagnostic exceptions or return structures instead of bare
(None, None).
- Keep changes limited to making current route preparation testable and explainable.
Parent sprint: #87
Depends on: #88, #89, #90, #91, #92, #93, #94
Recommended order: 9
Codex-ready: yes
Goal
Add contract tests proving that indexed inventory can actually satisfy current lvl1 route-selection and assembly-input discovery logic.
Background
BuildCompiler.assembly_lvl1()depends on several pieces lining up correctly:_extract_design_parts(...)extracts the ordered design components;_construct_plasmid_dict(...)finds indexed part plasmids;_get_backbone(...)chooses a compatible backbone;get_compatible_plasmids(...)validates fusion-site compatibility;Assembly(...)receives well-formedPlasmidobjects.When this fails today, the error may not clearly distinguish indexing failure, selector failure, missing reagent, missing backbone, or assembly failure.
Scope
Add tests that start from local fixture documents and stop before or at lvl1 assembly input creation. Suggested coverage:
_get_backbone()does not silently return(None, None)without a useful diagnostic.Non-goals
Acceptance criteria
Verification
Codex implementation notes
(None, None).