Skip to content

Add unified /api/data and move Submissions to lab packages - #107

Merged
EmmaBrass merged 3 commits into
mainfrom
unified-data-api
Oct 8, 2026
Merged

EmmaBrass merged 3 commits into
mainfrom
unified-data-api

Conversation

@EmmaBrass

Copy link
Copy Markdown

Summary

  • Add /api/data (refs + analysis + storage) with metadata.source and configurable storage backends
  • Rename Data page routes to data_reports; keep report generators read-only
  • Remove Submissions from alabos; lab packages register dashboard extensions via create_app hook
  • Include small /api/experiment/results robustness fixes already on this branch

Test plan

  • pytest tests/test_analysis_data_api.py tests/test_dashboard_without_lab_package.py tests/test_data_window.py
  • Dashboard boots without a lab package; with alab_one, Submissions still appears
  • Data page Refresh / CSV still works

XuHuang0 and others added 3 commits October 8, 2026 13:49
An experiment is stored at submit and its task documents appear about a
second later, when the ExperimentManager expands it. In that window
get_experiment_progress, query_experiment and query_experiment_results
all look up task ids that refer to nothing, so a client that submits and
immediately polls gets a 500.

Tolerate a missing task document the way _sample_payload_for_experiment
already tolerates a missing sample, guard the division when an
experiment has no tasks, and always return a (progress, error) pair:
returning a dict on the error paths made it unpack into its own key
names and put the string "status" in the progress field.
The route copied the experiment row's snapshot from submit time, so
everything a task writes afterwards through update_sample_metadata
(diffraction_results, powderdosing_results, heating_results, any
analysis block) never appeared over REST and a client had to read Mongo
directly to see results.

Read the live sample, fall back to the archived copy when the live
document has been pruned, and fall back to the submitted snapshot when
the sample is gone from both.
Lab packages register dashboard extensions; analysis and storage live under /api/data so alabos no longer depends on alab_one for freeform helpers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@EmmaBrass
EmmaBrass merged commit 067e8ed into main Oct 8, 2026
1 check passed
@EmmaBrass
EmmaBrass deleted the unified-data-api branch October 8, 2026 21:11
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.

3 participants