Skip to content

Commit cb133a8

Browse files
committed
docs: align bloom beta contract docs
1 parent 0122840 commit cb133a8

File tree

3 files changed

+80
-55
lines changed

3 files changed

+80
-55
lines changed

README.md

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,24 @@ Bloom owns:
66

77
- containers
88
- specimens
9+
- derived samples
910
- plates and wells
1011
- extraction outputs
1112
- library prep outputs
1213
- pools
1314
- sequencing runs
15+
- sequenced library assignments
1416
- queue membership and queue-transition state for wet-lab execution
1517

1618
Bloom does not own:
1719

1820
- accessioning
19-
- customer, order, patient, provider, shipment, or kit truth
21+
- customer, TRF, Test, patient, provider, shipment, or kit truth
2022
- workflow or workflow-step orchestration for the beta path
2123

2224
## Beta Architecture
2325

24-
The active beta path is queue-driven.
26+
The active beta path is queue-driven and graph-native.
2527

2628
Canonical queues:
2729

@@ -35,21 +37,29 @@ Canonical queues:
3537
- `ilmn_start_seq_run`
3638
- `ont_start_seq_run`
3739

38-
Atlas records intake outcomes first. Bloom accepts only Atlas-approved material, stores explicit Atlas external links on Bloom-owned objects, and preserves lineage from specimen and container through plate and well placement, library prep, pooling, and sequencing run creation.
40+
Atlas records intake outcomes first. Bloom accepts only Atlas-approved material, links that material to Atlas TRF/Test/process-item context through explicit graph-linked reference objects, and preserves lineage from specimen/container through plate and well placement, library prep, pooling, sequencing run creation, and sequenced library assignment.
3941

40-
Ursa resolves `run_euid + index_string` through Bloom and receives:
42+
Ursa resolves the canonical sequencing unit through Bloom with:
4143

44+
- `run_euid`
45+
- `flowcell_id`
46+
- `lane`
47+
- `library_barcode`
48+
49+
Bloom returns:
50+
51+
- `sequenced_library_assignment_euid`
4252
- `atlas_tenant_id`
43-
- `atlas_order_euid`
44-
- `atlas_test_order_euid`
53+
- `atlas_trf_euid`
54+
- `atlas_test_euid`
55+
- `atlas_test_process_item_euid`
4556

4657
Public beta APIs return EUIDs only. Internal UUIDs are not part of the supported contract.
4758

4859
## Active Beta APIs
4960

5061
Atlas and Ursa integration paths live under:
5162

52-
- `/api/v1/external/specimens`
5363
- `/api/v1/external/atlas`
5464
- `/api/v1/external/atlas/beta`
5565

@@ -62,26 +72,27 @@ The queue-driven beta endpoints are:
6272
- `POST /api/v1/external/atlas/beta/library-prep`
6373
- `POST /api/v1/external/atlas/beta/pools`
6474
- `POST /api/v1/external/atlas/beta/runs`
65-
- `GET /api/v1/external/atlas/beta/runs/{run_euid}/resolve?index_string=...`
75+
- `GET /api/v1/external/atlas/beta/runs/{run_euid}/resolve?flowcell_id=...&lane=...&library_barcode=...`
76+
- `POST /api/v1/external/atlas/tests/{test_euid}/status-events`
6677

6778
## Legacy Isolation
6879

69-
Legacy workflow and `do_action` code still exists in the repo for non-beta surfaces and historical GUI paths, but it is not on the active beta integration route. The old `/api/v1/actions/execute` API has been retired from the active API surface.
70-
71-
If a codepath depends on workflow-step runtime, accession ownership, or UUID-based external contracts, it is not part of the supported beta system.
80+
Legacy workflow and `do_action` code may still exist on disk for retired surfaces, but it is not part of the active beta integration path. If a codepath depends on workflow-step runtime, accession ownership, or UUID-based external contracts, it is not part of the supported beta system.
7281

7382
## Development
7483

75-
Bloom runs on the TapDB-backed adapter layer used across the LSMC refactor. The beta queue flow uses explicit object creation, lineage writes, targeted lookup queries, and idempotency keys on direct integration calls.
84+
Bloom runs on the TapDB-backed adapter layer used across the LSMC refactor. The beta queue flow uses explicit object creation, lineage writes, targeted lookup queries, process-item references, and idempotency keys on direct integration calls.
7685

77-
Focused validation commands for the beta refactor:
86+
Focused validation commands for the beta path:
7887

7988
```bash
8089
source bloom_activate.sh
81-
pytest tests/test_api_atlas_bridge.py tests/test_atlas_lookup_resilience.py tests/test_queue_flow.py tests/test_run_resolver.py
90+
pytest --no-cov tests/test_api_atlas_bridge.py tests/test_atlas_lookup_resilience.py tests/test_queue_flow.py tests/test_run_resolver.py tests/test_beta_cross_repo_smoke.py
8291
ruff check bloom_lims tests
8392
```
8493

85-
## Remaining Shared-Library Gap
94+
## Cross-Repo References
8695

87-
Bloom no longer uses the retired API-level `do_action` route for beta execution, but the repo still lacks first-class TapDB modern action templates dedicated to the new lab-operation events. That shared-library gap is documented in [docs/tapdb_required_changes.md](/Users/jmajor/projects/lims3/bloom/docs/tapdb_required_changes.md).
96+
- active Bloom beta API contract: [docs/bloom_beta_api_contracts.md](/Users/jmajor/projects/lims3/bloom/docs/bloom_beta_api_contracts.md)
97+
- queue/runtime execution summary: [docs/bloom_queue_refactor_execplan.md](/Users/jmajor/projects/lims3/bloom/docs/bloom_queue_refactor_execplan.md)
98+
- parent beta contract: [/Users/jmajor/projects/lims3/_refactor/cross_repo_contracts.md](/Users/jmajor/projects/lims3/_refactor/cross_repo_contracts.md)

docs/bloom_beta_api_contracts.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
## Accepted Material Registration
44

5-
Bloom accepts Atlas-approved material only after Atlas records an `ACCEPTED` intake outcome.
5+
Bloom accepts Atlas-approved material only after Atlas records an `ACCEPTED` intake outcome and materializes one or more test process items.
66

77
Minimum request context:
88

9-
- Atlas identity context for the accepted item
10-
- Atlas order EUID
11-
- Atlas test-order EUID
9+
- `trf_euid`
10+
- `test_euids[]`
11+
- patient context
12+
- shipment or test kit context
13+
- queue intent
1214
- idempotency key
1315

14-
Bloom response must include EUID-only identifiers for created material and explicit Atlas-link metadata.
16+
Bloom persists Atlas linkage through graph-linked reference objects and returns EUID-only identifiers for created material plus `process_item_euids[]`.
1517

1618
Implemented endpoint:
1719

@@ -36,23 +38,28 @@ Canonical beta queues:
3638
Input:
3739

3840
- `run_euid`
39-
- `index_string`
41+
- `flowcell_id`
42+
- `lane`
43+
- `library_barcode`
4044

4145
Output:
4246

47+
- `sequenced_library_assignment_euid`
4348
- `atlas_tenant_id`
44-
- `atlas_order_euid`
45-
- `atlas_test_order_euid`
49+
- `atlas_trf_euid`
50+
- `atlas_test_euid`
51+
- `atlas_test_process_item_euid`
4652

4753
Rules:
4854

4955
- response is deterministic and replay-safe
5056
- response contains no private UUIDs
51-
- resolver uses Bloom lineage plus explicit Atlas external links
57+
- resolver traverses Bloom lineage and graph-linked reference objects
58+
- one full resolver key maps to exactly one sequenced library assignment
5259

5360
Implemented endpoint:
5461

55-
- `GET /api/v1/external/atlas/beta/runs/{run_euid}/resolve?index_string=...`
62+
- `GET /api/v1/external/atlas/beta/runs/{run_euid}/resolve?flowcell_id=...&lane=...&library_barcode=...`
5663

5764
Other queue-driven beta endpoints:
5865

@@ -62,6 +69,7 @@ Other queue-driven beta endpoints:
6269
- `POST /api/v1/external/atlas/beta/library-prep`
6370
- `POST /api/v1/external/atlas/beta/pools`
6471
- `POST /api/v1/external/atlas/beta/runs`
72+
- `POST /api/v1/external/atlas/tests/{test_euid}/status-events`
6573

6674
## Status And Reliability
6775

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,45 @@
1-
# Bloom Queue Refactor Execution Plan
1+
# Bloom Queue Refactor Execution Summary
22

3-
## Goal
3+
## Status
44

5-
Refactor Bloom into the authoritative beta owner of material objects and queue-driven wet-lab execution state, without relying on the legacy workflow/workflow-step runtime for active beta paths.
5+
This refactor is complete for the active beta path.
66

7-
## Current Findings
7+
Bloom is now the beta authority for material lineage and queue-driven wet-lab execution without depending on workflow/workflow-step runtime on the supported Atlas/Ursa path.
88

9-
- `bloom_lims/core/action_execution.py` still routes through legacy object/workflow executors and legacy required-field extraction.
10-
- `bloom_lims/domain/base.py` still contains active `do_action_*` plumbing and grouped action payload assumptions.
11-
- `bloom_lims/domain/workflows.py` still performs queue routing through workflow-step objects.
12-
- `bloom_lims/domain/external_specimens.py` still uses broad scans for reference and idempotency lookup paths.
13-
- No resolver currently exists for `run_euid + index_string`.
9+
## Active Model
1410

15-
## Decisions
11+
- queue membership is represented by graph relationships
12+
- Atlas intent enters Bloom through explicit test-process-item reference objects
13+
- lineage is preserved from accepted material through extraction, library prep, pooling, run creation, and sequenced library assignment
14+
- the canonical resolver unit is `sequenced_library_assignment`
1615

17-
- The beta queue model will be explicit and first-class; it will not be represented as active workflow/workflow-step runtime.
18-
- Bloom will preserve material lineage with `generic_instance_lineage`.
19-
- Atlas links will stay explicit through external-object link instances rather than embedded private identifiers.
20-
- Public beta APIs will be EUID-only.
21-
- Existing workflow code may remain on disk temporarily, but it must not remain on the active beta-critical path.
16+
## Canonical Resolver
2217

23-
## Implementation Outline
18+
Bloom resolves:
2419

25-
1. Add queue-domain services for beta queue definition, membership, transition, and lineage-aware movement.
26-
2. Add sequencing-run and run-index resolution services that return Atlas order and test-order EUIDs.
27-
3. Keep external specimen creation as the Atlas entry point for accepted material, but rewrite its lookup paths to avoid broad scans.
28-
4. Remove workflow router exposure from the active beta API surface and stop documenting workflow/workflow-step as the primary model.
29-
5. Replace or isolate legacy action execution paths so beta queue transitions use modern TapDB-backed execution only.
20+
- `run_euid`
21+
- `flowcell_id`
22+
- `lane`
23+
- `library_barcode`
3024

31-
## Required Validation
25+
Bloom returns:
3226

33-
- create/register container plus specimen with Atlas external links
34-
- place accepted material into an extraction queue
35-
- map extraction output into plate/well lineage
36-
- advance through post-extract QC and lib prep queue selection
37-
- create pool and sequencing run
38-
- resolve `run_euid + index_string`
39-
- confirm public API payloads do not expose private UUIDs
27+
- `sequenced_library_assignment_euid`
28+
- `atlas_tenant_id`
29+
- `atlas_trf_euid`
30+
- `atlas_test_euid`
31+
- `atlas_test_process_item_euid`
32+
33+
## Legacy Isolation
34+
35+
Retired workflow and `do_action` surfaces are not part of the active beta route. If a path depends on workflow-step runtime, accession ownership, or legacy action execution, treat it as non-beta.
36+
37+
## Validation
38+
39+
Focused validation for the active beta path:
40+
41+
```bash
42+
source bloom_activate.sh
43+
pytest --no-cov tests/test_api_atlas_bridge.py tests/test_atlas_lookup_resilience.py tests/test_queue_flow.py tests/test_run_resolver.py tests/test_beta_cross_repo_smoke.py
44+
ruff check bloom_lims tests
45+
```

0 commit comments

Comments
 (0)