[ISSUE-08] Port AssemblyService behind clean SBOL assembly interface#75
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc95f5f676
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| implementation = source_document.find(impl_identity) if impl_identity else None | ||
|
|
||
| if implementation is None: |
There was a problem hiding this comment.
Validate plasmid implementation type before returning
When metadata['implementation_identity'] points to an existing non-sbol2.Implementation object (for example a ComponentDefinition), this method returns it without validation because only None triggers the fallback path. That invalid object is then passed into legacy assembly and eventually into part_digestion, which expects an implementation and dereferences .built, causing a runtime failure instead of the wrapper’s intended clear ValueError for bad SBOL inputs.
Useful? React with 👍 / 👎.
Motivation
sbol2objects at the SBOL service boundary and return normalized generated products asIndexedPlasmidrecords annotated with provenance.Description
src/buildcompiler/sbol/assembly.pyimplementingAssemblyJob,AssemblySbolResult, andAssemblyServiceand private adapter helpers that resolveIndexedPlasmid/IndexedBackbone/IndexedReagentinto the legacy shapes expected bysbol2build.Assembly.AssemblyService.run(job: AssemblyJob) -> AssemblySbolResultmethod adapts normalized inputs, delegates to the existingAssemblyimplementation fromsrc/buildcompiler/sbol2build.py, preserves SBOL activity/product behavior, and maps legacy products back toIndexedPlasmidwithstate=MaterialState.GENERATEDand provenance metadata.src/buildcompiler/sbol/__init__.pyso callers can importAssemblyService,AssemblyJob, andAssemblySbolResultalongsideSbolResolver.tests/unit/sbol/test_assembly_service.pythat cover the wrapper contract: a successful run (legacy assembly monkeypatched to isolate the wrapper) and clearValueErrorbehavior when required SBOL inputs are missing.Testing
python -c "from buildcompiler.sbol import AssemblyService, AssemblyJob, AssemblySbolResult"andpython -c "from buildcompiler.domain import IndexedPlasmid, IndexedBackbone, IndexedReagent"both succeeded.pytest tests/unit/sboland thenpytest tests/unit/domain tests/unit/api tests/unit/inventory tests/unit/planning tests/unit/sbolwere executed; final run results:41 passed(all targeted unit tests passed).uv): attempts to runuv run ruff check .,uv run ruff format --check ., anduv run pytest tests/unit/sbolinitially failed becauseuvattempted to fetch the optionalSBOLInventorydependency from a git URL and the environment blocked that network fetch (git fetch error / HTTP 403). This is an environment/network failure and not a code failure; localpytestruns succeeded afterwards.Codex Task