Skip to content

Implement BuildCompiler transformation orchestration stage#44

Open
Gonza10V wants to merge 1 commit intotransformationfrom
codex/implement-transformation-feature-for-buildcompiler
Open

Implement BuildCompiler transformation orchestration stage#44
Gonza10V wants to merge 1 commit intotransformationfrom
codex/implement-transformation-feature-for-buildcompiler

Conversation

@Gonza10V
Copy link
Copy Markdown
Contributor

@Gonza10V Gonza10V commented Apr 9, 2026

Summary

  • implemented BuildCompiler.transformation(...) in src/buildcompiler/buildcompiler.py
  • added deterministic transformation output contract with:
    • normalized input handling for Plasmid, ComponentDefinition, and dict payloads
    • SBOL artifact creation for transformation activities and transformed strains
    • JSON intermediate for OT-2/robot execution parameters
    • protocol placeholders, human instructions, and logs
  • added private helpers to keep orchestration logic explicit and testable:
    • _normalize_transformation_inputs
    • _get_or_create_chassis
    • _get_or_create_plasmid_implementation
    • _add_if_absent
  • added new tests in tests/test_buildcompiler_transformation.py for:
    • nominal component-definition inputs
    • dict payload inputs
    • empty-input validation error

Validation

  • ruff check src/buildcompiler/buildcompiler.py tests/test_buildcompiler_transformation.py
  • python -m unittest tests.test_buildcompiler_transformation ⚠️ failed in this environment because sbol2 is not installed and package installation is blocked by proxy/network restrictions

Notes

  • This PR intentionally implements Phase 1 only (transformation).
  • plating and full_build orchestration are left for subsequent phases.

Codex Task

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: f4a8701c68

ℹ️ 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 +798 to +800
plasmid_impl_id = f"{plasmid.displayId}_impl"
plasmid_impl = doc.find(plasmid_impl_id) or sbol2.Implementation(plasmid_impl_id)
plasmid_impl.built = plasmid.identity
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use plasmid identity (not displayId) for impl lookup

This implementation key is derived only from plasmid.displayId, so two distinct plasmids that share a displayId (for example different SBOL versions or namespace variants) are forced to reuse one Implementation. Because the code then unconditionally sets plasmid_impl.built = plasmid.identity, later transformations can silently retarget the shared implementation and invalidate provenance for earlier activities/usages that referenced it.

Useful? React with 👍 / 👎.

Comment on lines +428 to +429
transformed_strain = sbol2.ModuleDefinition(
f"{chassis_name}_with_{plasmid.displayId}"
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 Make transformed strain IDs unique per transformation step

The transformed strain identity is based only on chassis_name and plasmid.displayId, so repeated inputs (or different plasmids with the same displayId) collide on the same ModuleDefinition/Implementation IDs. In those cases _add_if_absent suppresses later objects, and multiple transformation steps can map to the same SBOL artifact URI, losing a one-step-to-one-artifact mapping.

Useful? React with 👍 / 👎.

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