Replace run_report_data table with S3 CSV files for plate reader data - #31
Merged
Conversation
… reader data The SpectraMax Lambda now writes well data to a CSV in the S3 processed bucket and registers it as a processed file record, instead of inlining the entire DataFrame as JSON in the PATCH /files/:fileId request body. This avoids Vercel's function payload limit for large kinetic files. - Lambda: write CSV to processed bucket, remove report_data from API client - API: strip report_data insert/delete from PATCH /files and GET /runs - UI: add server-side CSV loader; source plate map grids from S3 at render - MCP: remove get_run_report_data tool, update prompts to use file download - Schema: drop run_report_data table (migration 0004) - Tests/docs: update across Lambda, web-app, and watcher
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
run_report_dataPostgres table is dropped; the plate reader UI fetches and parses the CSV from S3 at render time.get_run_report_dataMCP tool is removed; clients uselist_run_files+get_file_download_urlto access processed data.Changes
Lambda
spectramax_plate_reader/process_file.py— Writes well data to a local CSV, uploads it to the S3 processed bucket, and registers it as acategory="processed"file record. Removesreport_datafrom theupdate_filecall.api_client.py— Removes thereport_dataparameter fromupdate_file().Web app API
PATCH /files/:fileId— Removes thereport_datainsert block and therunReportDatadelete on reprocess transition.GET /runs/:runId— Removes therunReportDataquery andreport_datafrom the JSON response.file-reprocessing.ts— Removes thetx.delete(runReportData)transaction; now a simple status update.Web app UI
instrument-runs.ts— AddsgetProcessedCsvData()helper that fetches processed CSV files from S3 and parses them intoRawWellRow[]. RemovesgetRunReportData()andRunReportEntrytype.run-detail.ts—RunDetailProps.reportDatareplaced withwellData: RawWellRow[].getProcessedCsvData(runFiles)instead ofgetRunReportData(run.id).plate-reader-run-detail.tsx— Refactored to consumewellDatarows directly instead ofRunReportEntrywrappers.default-run-detail.tsx— RemovesreportDatasplitting logic.delete-run-dialog.tsx—hasReportDataprop replaced withhasProcessedFiles, computed from processed file count.run-analysis-section.tsx— Simplified to a standalone "coming soon" section (no moreanalysisDataprop).run-report-section.tsx— Simplified to show only processed images; removesRunReportEntrydependency.MCP
tools.ts— Removes theget_run_report_datatool registration.prompts.ts— Updatesrun_analysisandcompare_runsprompts to uselist_run_files+get_file_download_url.Schema
schema.ts— Deletes therunReportDatatable definition.drizzle/0004_keen_gorilla_man.sql—DROP TABLE "run_report_data" CASCADE.Tests
report_data; reprocess test verifies CSV file idempotency.run_report_datafrom truncation lists.report_dataassertions from files, runs, and MCP tests.Docs
lambda.md,mcp.md,architecture.md,guides/adding-an-instrument.md— Updated to reflect the S3 CSV pattern.Breaking changes
GET /api/v1/instruments/:instrumentId/runs/:runIdresponse no longer includes thereport_datafield. Any external consumers readingreport_datafrom this endpoint must switch tolist_run_filesto find processed CSVs and download them via presigned URLs.get_run_report_dataMCP tool is removed. MCP clients referencing it will get a tool-not-found error and should uselist_run_files+get_file_download_urlinstead.report_datafield inPATCH /api/v1/files/:fileIdrequest bodies is now ignored.0004drops therun_report_datatable — this is irreversible and must be run after all Lambda deployments are using the new CSV path.Driveby changes
docs/guides/adding-an-instrument.md— Renumbered sub-headings under Step 4 from### 1through### 5to### 4.1through### 4.5for correct nesting.docs/architecture.md— AddedL -->|processed data| S3arrow to the system overview diagram.Testing
pytest -m integrationinlambda/)npm testinweb-app/)get_run_report_data)make check-allpasses (formatting, lint, type checks).xlscompletes, processed CSV appears in S3 and as a file record, plate map grid renders on the run detail page0004against staging DB and confirm therun_report_datatable is dropped cleanly