Skip to content

[SPRINT-02-11] Harden transformation SBOL output and chaining tests #98

@Gonza10V

Description

@Gonza10V

Parent sprint: #87
Depends on: #88, #89, #90, #91, #92, #93, #94, #96, #97
Recommended order: 11
Codex-ready: yes

Goal

Add tests and small fixes so transformation consumes assembly outputs consistently and produces stable SBOL artifacts and JSON intermediates that plating can consume.

Background

BuildCompiler.transformation() currently accepts Plasmid objects, ComponentDefinitions, or dictionaries with a plasmid key. It normalizes inputs, creates chassis objects, calls SBOL2Transformation(...).chemical_transformation(), and returns a dict with sbol_artifacts, json_intermediate, protocol_artifacts, and logs.

This is a useful implementation, but it needs contract tests proving it handles the outputs from assembly_lvl1() and produces deterministic, reloadable SBOL references.

Scope

Add tests for transformation inputs:

  • canonical Plasmid objects produced by lvl1 assembly;
  • raw sbol2.ComponentDefinition plasmid inputs;
  • dictionaries containing plasmid entries;
  • invalid or empty inputs.

Add tests for transformation outputs:

  • transformation activity identity/reference exists in the SBOL document;
  • transformed strain ModuleDefinition is created;
  • transformed strain Implementation is created;
  • output artifact dict contains stable keys;
  • json_intermediate has deterministic protocol/version/steps shape;
  • plating input normalization can consume the transformation result.

If necessary, add small fixes to make identities and errors deterministic.

Non-goals

  • Do not implement wet-lab protocol execution.
  • Do not run Opentrons simulation.
  • Do not add PUDU as a core dependency.
  • Do not rewrite transformation into the future clean-architecture stage package yet.

Acceptance criteria

  • Transformation accepts lvl1 assembly products from [SPRINT-02-10] Validate lvl1 Assembly SBOL artifacts and remove default JSON side effects #97.
  • Transformation rejects invalid/empty input with a clear error.
  • Transformed strain module and implementation are present in the SBOL document.
  • SBOL output can serialize/reload or is otherwise asserted through deterministic object presence.
  • JSON intermediate shape is stable and tested.
  • normalize_plating_input(...) accepts transformation output.

Verification

pytest -k "transformation"
pytest -k "plating and normalize"
ruff check .

Codex implementation notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions