Independent analysis batches
The batch coordinator keeps ordered independent inputs and statuses outside the
Assay and Sequence scientific schemas. analysis-batch@1 is a local project kind;
it is not a pooled assay or a new numerical method. Every child uses the existing
selected analysis, reporting refusals and method versions. Comparison never treats
plates or fitted observations as independent biological experiments.
The common envelope reader is in src/lib/batch/model.ts. App adapters must also
validate scientific child payloads. Unknown versions and fields are refused;
refused, cancelled and not-run items remain part of the recoverable batch.
Implementation and final verification are recorded in
docs/progress/batch-2026-10-16.md during integration.
Inputs and independent analysis
The lazy Assay panel receives a frozen reviewed import and a scope/epoch captured
at the explicit transfer action. Editing the original import box does not alter
that copy. The researcher confirms that blocks are separate dose-response plates
and chooses a compatible reviewed map per plate. Reporter pairs and kinetic reads
are refused. Each child gets a fresh source ID, one plate, remapped review locations
and exclusions, and no previous results or experiment declarations. The existing
deriveCurves, sequential FitClient, summarise, method pins and dose-response
input hash produce each output. Display uses shownLogIC50 and shownInterval;
counts are fitted observations. No across-plate statistics are computed.
The Sequence adapter compares parsed record counts against FASTA/GenBank headers,
retains complete source text and exact per-record text, and uses the shared
loadedRecord conversion. The existing selected operation runs independently on
each record. Worker-sized six-frame, ORF and motif analyses use the existing worker
client sequentially. sheetRows supplies the values, units and method versions.
Empty, ambiguous, incompatible and operation-refused inputs remain visible.
Primer design is explicitly unavailable in this batch path.
The bounds are 24 plates, 4 MiB of original import/text and 400 derived curves for Assay; 100 records and 1,000,000 UTF-8 source bytes for Sequence. A shared Sequence template keeps its existing separate 1,000,000-byte bound. Bounds reject the whole batch before computation, without truncation. Comparison cells preview the first 1,000 characters of long outputs; recovery retains the full output.
Lifetime, cancellation and recovery
The queue captures exact input/settings identity, scope ID, scope epoch and a run generation. It yields between children, checks after every asynchronous boundary, and disposes workers on input replacement, scope changes or unmount. UI action lifetimes also guard file reads, services and transactional writes. Previous-scope inputs, comparison cells and saved-batch lists are hidden. An input/settings edit retains completed cells as stale and marks an interrupted row cancelled. It cannot record those outputs as current.
User cancellation preserves completed children, cancels the interrupted child and leaves subsequent children not run. Resume retries failed, cancelled and not-run inputs; it retains completed and refused rows. A fresh run recomputes all children. Opening a saved or imported batch shows previous outputs as stale and requires a fresh run before recording. Historical values are not silently recomputed during recovery admission.
createBatchStore explicitly validates before both project creation and
revision-checked save; createProjectStore.create alone is insufficient. Its
fixed-scope transaction wrapper also checks the actual epoch during writes and
prevents an unsafe independent quota fallback. The common reader, exact input
hash and app readers reject malformed versions, altered input membership and
inconsistent output/payload/row relationships. Assay retained outputs also pass
the existing dose-response input-integrity check. Sequence outputs are retained
as historical values until rerun; this is not a new independent numerical
verification engine.
Recovery uses the existing project-export envelope with kind analysis-batch
and schema 1. It includes every input/status, sequence text or plate reading,
source context and per-child output. It excludes original instrument-file bytes;
file name/hash/size remain provenance with retention explicitly false. Restoring
creates a new local project and removes local child/result receipts and planned
write identities. Unknown schema versions are refused before a write. Memory
fallback is stated explicitly and users can export recovery.
Recording reuses saveObjectBackedWork, the existing app capture adapter and
snapshot store with default stale rejection. Each child commits independently.
The coordinator checkpoints planned object IDs and prepared input/result IDs
before their corresponding write, then records receipts. A retry reuses committed
identities, including an interruption after a result committed but before its
receipt checkpoint. Completed children are unfiled Bench work; batch commands do
not implicitly assign Study membership. This is partial, per-child saving, not an
atomic batch transaction. All services work in the browser-local workspace with
no account or remote backup dependency.