Parent sprint: #87
Depends on: #88, #89, #90
Recommended order: 4
Codex-ready: yes
Goal
Introduce an explicit pull policy so local SBOL indexing and local design resolution do not silently call SynBioHub.
Background
abstract_translator.get_or_pull(doc, sbh, uri) currently pulls from SynBioHub whenever uri is missing from the document. That behavior is convenient for live SynBioHub mode but unsafe for local/offline debugging: a local test may pass because it secretly fetched missing objects, or fail in a way that looks like an indexing bug but is actually a network/pull issue.
Scope
Add a small policy enum or constants, for example:
class PullPolicy(Enum):
NEVER = "never"
MISSING_ONLY = "missing_only"
ALWAYS_REFRESH = "always_refresh"
Then update resolution helpers so callers can choose behavior explicitly:
def get_or_pull(doc, sbh, uri, pull_policy=PullPolicy.MISSING_ONLY): ...
Local indexing and local tests should use PullPolicy.NEVER.
Requirements
PullPolicy.NEVER: return local object if present; if missing, raise or record a structured unresolved reference without network access.
PullPolicy.MISSING_ONLY: preserve current behavior where missing objects are pulled.
PullPolicy.ALWAYS_REFRESH: optional if easy; acceptable to add enum value and raise NotImplementedError if not needed yet, but document it.
- Update
BuildCompiler local entry point to use NEVER by default.
- Keep current SynBioHub path behavior compatible by defaulting to
MISSING_ONLY where appropriate.
Non-goals
- Do not implement caching or remote synchronization.
- Do not require SynBioHub credentials in local tests.
- Do not change unrelated assembly/transformation behavior.
Acceptance criteria
Verification
Run:
pytest -k "pull_policy or local or get_or_pull or index"
ruff check .
Codex implementation notes
- Keep the policy simple.
- Do not overfit to future architecture.
- If changing
get_or_pull has many call sites, preserve default behavior and only pass NEVER from local indexing/test paths.
- Make failures precise: include the missing URI and current policy in the error/audit message.
Parent sprint: #87
Depends on: #88, #89, #90
Recommended order: 4
Codex-ready: yes
Goal
Introduce an explicit pull policy so local SBOL indexing and local design resolution do not silently call SynBioHub.
Background
abstract_translator.get_or_pull(doc, sbh, uri)currently pulls from SynBioHub wheneveruriis missing from the document. That behavior is convenient for live SynBioHub mode but unsafe for local/offline debugging: a local test may pass because it secretly fetched missing objects, or fail in a way that looks like an indexing bug but is actually a network/pull issue.Scope
Add a small policy enum or constants, for example:
Then update resolution helpers so callers can choose behavior explicitly:
Local indexing and local tests should use
PullPolicy.NEVER.Requirements
PullPolicy.NEVER: return local object if present; if missing, raise or record a structured unresolved reference without network access.PullPolicy.MISSING_ONLY: preserve current behavior where missing objects are pulled.PullPolicy.ALWAYS_REFRESH: optional if easy; acceptable to add enum value and raiseNotImplementedErrorif not needed yet, but document it.BuildCompilerlocal entry point to useNEVERby default.MISSING_ONLYwhere appropriate.Non-goals
Acceptance criteria
PullPolicy.NEVERdoes not callsbh.pull.Verification
Run:
Codex implementation notes
get_or_pullhas many call sites, preserve default behavior and only passNEVERfrom local indexing/test paths.