Skip to content

feat: add trajectory input schema - #3

Merged
jimmlucas merged 2 commits into
develop-v2from
feat/trajectory-input-schema
Jul 31, 2026
Merged

feat: add trajectory input schema#3
jimmlucas merged 2 commits into
develop-v2from
feat/trajectory-input-schema

Conversation

@jimmlucas

@jimmlucas jimmlucas commented Jul 30, 2026

Copy link
Copy Markdown
Owner

What changed

  • adds strict Pydantic v2 contracts for per-round metrics and complete polishing trajectories
  • validates schema version, round order, uniqueness, contiguity, R1 presence, biological ranges, and unknown fields
  • rejects numeric strings, booleans-as-numbers, blank sample identifiers, NaN, and infinity
  • connects validated histories to the canonical prospective FeatureBuilder
  • exposes prediction readiness and missing metrics without confusing missing history with zero improvement
  • adds explicit STOP, CONTINUE, and CONSERVATIVE_CONTINUE decision actions
  • enforces that decisions never request a round before the current round or beyond max_rounds
  • documents the JSON contract and includes a runtime-validated example

Why

ESDP v1 accepts an isolated metrics row, which cannot safely represent temporal features. A workflow-oriented v2 contract must carry the complete history available at each decision point and fail explicitly or continue conservatively when that history is incomplete. Strict typing prevents malformed workflow JSON from silently changing scientific values.

Compatibility and impact

  • the v1 PolishingMetrics, /predict endpoint, model, datasets, and published results are unchanged
  • the new module is additive and can be reused by the future API, CLI, and Nextflow adapters
  • required metrics remain explicit until they move into the model manifest
  • structural trajectory errors are rejected; missing metrics can either raise an error or trigger conservative continuation

Validation

  • trajectory, parity, and temporal tests — 31 passed
  • full suite — 92 passed
  • documented JSON example validated through PolishingTrajectory.model_validate
  • git diff --cached --check — clean

The 30 remaining warnings are pre-existing FastAPI/Pydantic/httpx deprecations in the v1 service.

@jimmlucas jimmlucas self-assigned this Jul 30, 2026
@jimmlucas
jimmlucas marked this pull request as ready for review July 31, 2026 10:01
@jimmlucas
jimmlucas merged commit ed1f7a6 into develop-v2 Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant