Skip to content

Add context runtime-config updates and decouple label extractor - #243

Merged
Tooyosi merged 1 commit into
mainfrom
context-update-and-modify-label-extractors
May 13, 2026
Merged

Add context runtime-config updates and decouple label extractor#243
Tooyosi merged 1 commit into
mainfrom
context-update-and-modify-label-extractors

Conversation

@Tooyosi

@Tooyosi Tooyosi commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR does two related things:

  1. adds a validated PATCH /contexts/:id update path for context fields and batch runtime metadata
  2. decouples label extractor resolution from Galaxy Zoo by introducing a registry that supports both code and DB extractors

What Changed

Context update and batch runtime config

  • adds update to resources :contexts
  • adds request validation for editable context fields
  • merges incoming metadata
  • validates metadata.batch through Batch::RuntimeConfig
  • rejects unresolved module_name / extractor_name pairs before persisting a context
  • adds specs covering valid and invalid payloads

Hybrid label extractor support

  • adds LabelExtractorDefinition with JSONB-backed extractor config
  • adds LabelExtractors::Registry for shared extractor resolution
  • adds LabelExtractors::ConfigurableExtractor for DB-backed task/answer mappings
  • updates LabelExtractors::Finder to resolve through the registry instead of the Galaxy Zoo-specific regex
  • updates training export header resolution to use the registry
  • preserves existing Galaxy Zoo extractor behavior as code-backed registrations

Why

Previously:

  • context updates for batch runtime config were not part of the standard contexts resource flow
  • label extractor lookup was structurally tied to Galaxy Zoo naming and Ruby classes

This change makes:

  • context runtime config editable through the API with validation
  • simple new modules onboardable without adding a new Ruby extractor class
  • reduction ingestion and training export use the same extractor resolution path

@Tooyosi
Tooyosi requested a review from lcjohnso April 27, 2026 10:39
@Tooyosi
Tooyosi merged commit 276a21f into main May 13, 2026
1 check passed
@Tooyosi
Tooyosi deleted the context-update-and-modify-label-extractors branch May 13, 2026 19:32
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.

2 participants