Skip to content

[ISSUE-08] Port AssemblyService behind clean SBOL assembly interface#75

Merged
Gonza10V merged 1 commit into
full_buildfrom
codex/port-assemblyservice-behind-clean-sbol-interface
May 6, 2026
Merged

[ISSUE-08] Port AssemblyService behind clean SBOL assembly interface#75
Gonza10V merged 1 commit into
full_buildfrom
codex/port-assemblyservice-behind-clean-sbol-interface

Conversation

@Gonza10V
Copy link
Copy Markdown
Contributor

@Gonza10V Gonza10V commented May 6, 2026

Motivation

  • Provide a clean, typed SBOL assembly service that wraps the existing Golden Gate assembly behavior so stages can consume/produce normalized domain records without changing the legacy digestion/ligation internals.
  • Keep raw sbol2 objects at the SBOL service boundary and return normalized generated products as IndexedPlasmid records annotated with provenance.

Description

  • Added src/buildcompiler/sbol/assembly.py implementing AssemblyJob, AssemblySbolResult, and AssemblyService and private adapter helpers that resolve IndexedPlasmid/IndexedBackbone/IndexedReagent into the legacy shapes expected by sbol2build.Assembly.
  • The AssemblyService.run(job: AssemblyJob) -> AssemblySbolResult method adapts normalized inputs, delegates to the existing Assembly implementation from src/buildcompiler/sbol2build.py, preserves SBOL activity/product behavior, and maps legacy products back to IndexedPlasmid with state=MaterialState.GENERATED and provenance metadata.
  • Exported the new assembly contracts from src/buildcompiler/sbol/__init__.py so callers can import AssemblyService, AssemblyJob, and AssemblySbolResult alongside SbolResolver.
  • Added unit tests tests/unit/sbol/test_assembly_service.py that cover the wrapper contract: a successful run (legacy assembly monkeypatched to isolate the wrapper) and clear ValueError behavior when required SBOL inputs are missing.

Testing

  • Import smoke tests: python -c "from buildcompiler.sbol import AssemblyService, AssemblyJob, AssemblySbolResult" and python -c "from buildcompiler.domain import IndexedPlasmid, IndexedBackbone, IndexedReagent" both succeeded.
  • Unit tests: pytest tests/unit/sbol and then pytest tests/unit/domain tests/unit/api tests/unit/inventory tests/unit/planning tests/unit/sbol were executed; final run results: 41 passed (all targeted unit tests passed).
  • Lint/format (via uv): attempts to run uv run ruff check ., uv run ruff format --check ., and uv run pytest tests/unit/sbol initially failed because uv attempted to fetch the optional SBOLInventory dependency 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; local pytest runs succeeded afterwards.

Codex Task

@Gonza10V
Copy link
Copy Markdown
Contributor Author

Gonza10V commented May 6, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +138 to +140
implementation = source_document.find(impl_identity) if impl_identity else None

if implementation is None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@Gonza10V Gonza10V merged commit 366efce into full_build May 6, 2026
0 of 4 checks passed
@Gonza10V Gonza10V deleted the codex/port-assemblyservice-behind-clean-sbol-interface branch May 6, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant