Repository navigation
Add unified /api/data and move Submissions to lab packages - #107
Merged
Merged
Conversation
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>
This was referenced Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/data(refs + analysis + storage) withmetadata.sourceand configurable storage backendsdata_reports; keep report generators read-onlycreate_apphook/api/experiment/resultsrobustness fixes already on this branchTest plan
pytest tests/test_analysis_data_api.py tests/test_dashboard_without_lab_package.py tests/test_data_window.py