bijux-proteomics-runtime 0.3.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- LICENSE +192 -0
- NOTICE +3 -0
- bijux_proteomics_runtime/__init__.py +26 -0
- bijux_proteomics_runtime/api/__init__.py +15 -0
- bijux_proteomics_runtime/api/app.py +259 -0
- bijux_proteomics_runtime/api/catalog.py +629 -0
- bijux_proteomics_runtime/api/cli.py +1136 -0
- bijux_proteomics_runtime/api/command_output.py +64 -0
- bijux_proteomics_runtime/api/errors.py +228 -0
- bijux_proteomics_runtime/api/public.py +27 -0
- bijux_proteomics_runtime/api/request_context.py +18 -0
- bijux_proteomics_runtime/api/request_logging.py +89 -0
- bijux_proteomics_runtime/api/routes/__init__.py +4 -0
- bijux_proteomics_runtime/api/routes/adapter_conformance.py +59 -0
- bijux_proteomics_runtime/api/routes/decision_briefs.py +79 -0
- bijux_proteomics_runtime/api/routes/evidence_graph.py +63 -0
- bijux_proteomics_runtime/api/routes/lab_handoffs.py +61 -0
- bijux_proteomics_runtime/api/routes/ptm_reports.py +52 -0
- bijux_proteomics_runtime/api/routes/quant_reports.py +52 -0
- bijux_proteomics_runtime/api/routes/runtime_execution.py +57 -0
- bijux_proteomics_runtime/api/v1/__init__.py +4 -0
- bijux_proteomics_runtime/api/v1/endpoints/__init__.py +22 -0
- bijux_proteomics_runtime/api/v1/endpoints/compare.py +56 -0
- bijux_proteomics_runtime/api/v1/endpoints/external_import.py +73 -0
- bijux_proteomics_runtime/api/v1/endpoints/inspect.py +73 -0
- bijux_proteomics_runtime/api/v1/endpoints/resume.py +105 -0
- bijux_proteomics_runtime/api/v1/endpoints/run.py +93 -0
- bijux_proteomics_runtime/api/v1/endpoints/runtime_contracts.py +244 -0
- bijux_proteomics_runtime/api/v1/router.py +27 -0
- bijux_proteomics_runtime/api/v1/schema.py +450 -0
- bijux_proteomics_runtime/api/workflow_story.py +103 -0
- bijux_proteomics_runtime/checkpoints/__init__.py +32 -0
- bijux_proteomics_runtime/checkpoints/scientific.py +346 -0
- bijux_proteomics_runtime/diff/__init__.py +20 -0
- bijux_proteomics_runtime/diff/completed_runs.py +202 -0
- bijux_proteomics_runtime/execution/__init__.py +12 -0
- bijux_proteomics_runtime/execution/agents/__init__.py +8 -0
- bijux_proteomics_runtime/execution/agents/analysis/__init__.py +8 -0
- bijux_proteomics_runtime/execution/agents/analysis/failure_analysis.py +79 -0
- bijux_proteomics_runtime/execution/agents/analysis/sequence_analysis.py +75 -0
- bijux_proteomics_runtime/execution/agents/analysis/structure.py +82 -0
- bijux_proteomics_runtime/execution/agents/base/__init__.py +7 -0
- bijux_proteomics_runtime/execution/agents/base/base.py +64 -0
- bijux_proteomics_runtime/execution/agents/catalog.py +45 -0
- bijux_proteomics_runtime/execution/agents/contracts.py +143 -0
- bijux_proteomics_runtime/execution/agents/coordination/__init__.py +8 -0
- bijux_proteomics_runtime/execution/agents/coordination/coordinator.py +199 -0
- bijux_proteomics_runtime/execution/agents/planning/__init__.py +8 -0
- bijux_proteomics_runtime/execution/agents/planning/compiler.py +60 -0
- bijux_proteomics_runtime/execution/agents/planning/generation.py +45 -0
- bijux_proteomics_runtime/execution/agents/planning/planner.py +130 -0
- bijux_proteomics_runtime/execution/agents/planning/schemas.py +203 -0
- bijux_proteomics_runtime/execution/agents/planning/validation.py +128 -0
- bijux_proteomics_runtime/execution/agents/reporting/__init__.py +8 -0
- bijux_proteomics_runtime/execution/agents/reporting/reporting.py +76 -0
- bijux_proteomics_runtime/execution/agents/schemas.py +417 -0
- bijux_proteomics_runtime/execution/agents/verification/__init__.py +8 -0
- bijux_proteomics_runtime/execution/agents/verification/critic.py +96 -0
- bijux_proteomics_runtime/execution/agents/verification/input_validation.py +80 -0
- bijux_proteomics_runtime/execution/agents/verification/quality_control.py +93 -0
- bijux_proteomics_runtime/execution/compiler/__init__.py +8 -0
- bijux_proteomics_runtime/execution/compiler/boundary.py +66 -0
- bijux_proteomics_runtime/execution/engine/__init__.py +15 -0
- bijux_proteomics_runtime/execution/engine/executor.py +128 -0
- bijux_proteomics_runtime/execution/engine/integration.py +52 -0
- bijux_proteomics_runtime/execution/evaluation/__init__.py +5 -0
- bijux_proteomics_runtime/execution/evaluation/evaluation.py +334 -0
- bijux_proteomics_runtime/execution/evaluation/observations.py +26 -0
- bijux_proteomics_runtime/execution/evaluation/schemas.py +107 -0
- bijux_proteomics_runtime/execution/graph_validation.py +55 -0
- bijux_proteomics_runtime/execution/public.py +41 -0
- bijux_proteomics_runtime/execution/schemas.py +40 -0
- bijux_proteomics_runtime/execution/tools/__init__.py +14 -0
- bijux_proteomics_runtime/execution/tools/base.py +41 -0
- bijux_proteomics_runtime/execution/tools/catalog.py +45 -0
- bijux_proteomics_runtime/execution/tools/contracts.py +44 -0
- bijux_proteomics_runtime/execution/tools/heuristic.py +69 -0
- bijux_proteomics_runtime/execution/tools/schemas.py +32 -0
- bijux_proteomics_runtime/execution/validation.py +16 -0
- bijux_proteomics_runtime/governance/__init__.py +8 -0
- bijux_proteomics_runtime/governance/charter.py +440 -0
- bijux_proteomics_runtime/governance/compatibility_bridges.py +158 -0
- bijux_proteomics_runtime/handoff/__init__.py +20 -0
- bijux_proteomics_runtime/handoff/archive.py +220 -0
- bijux_proteomics_runtime/parallel/__init__.py +28 -0
- bijux_proteomics_runtime/parallel/execution.py +262 -0
- bijux_proteomics_runtime/providers/__init__.py +45 -0
- bijux_proteomics_runtime/providers/assurance.py +268 -0
- bijux_proteomics_runtime/providers/builtin/heuristic.py +45 -0
- bijux_proteomics_runtime/providers/capabilities.py +108 -0
- bijux_proteomics_runtime/providers/catalog.py +224 -0
- bijux_proteomics_runtime/providers/contracts.py +199 -0
- bijux_proteomics_runtime/providers/environment.py +541 -0
- bijux_proteomics_runtime/providers/errors.py +24 -0
- bijux_proteomics_runtime/providers/local/__init__.py +53 -0
- bijux_proteomics_runtime/providers/local/esmfold.py +498 -0
- bijux_proteomics_runtime/providers/local/rosettafold.py +231 -0
- bijux_proteomics_runtime/providers/remote/__init__.py +20 -0
- bijux_proteomics_runtime/providers/remote/_async_utils.py +45 -0
- bijux_proteomics_runtime/providers/remote/colabfold.py +263 -0
- bijux_proteomics_runtime/providers/remote/openprotein.py +361 -0
- bijux_proteomics_runtime/providers/selection.py +122 -0
- bijux_proteomics_runtime/public_api.py +85 -0
- bijux_proteomics_runtime/py.typed +0 -0
- bijux_proteomics_runtime/rehydrate/__init__.py +10 -0
- bijux_proteomics_runtime/rehydrate/loading.py +44 -0
- bijux_proteomics_runtime/resume/__init__.py +32 -0
- bijux_proteomics_runtime/resume/execution.py +254 -0
- bijux_proteomics_runtime/runs/__init__.py +8 -0
- bijux_proteomics_runtime/runs/analysis.py +81 -0
- bijux_proteomics_runtime/runs/artifacts.py +469 -0
- bijux_proteomics_runtime/runs/cache.py +112 -0
- bijux_proteomics_runtime/runs/checkpoints.py +82 -0
- bijux_proteomics_runtime/runs/cleanup.py +86 -0
- bijux_proteomics_runtime/runs/context.py +77 -0
- bijux_proteomics_runtime/runs/contracts.py +222 -0
- bijux_proteomics_runtime/runs/correlation.py +50 -0
- bijux_proteomics_runtime/runs/execution_decisions.py +197 -0
- bijux_proteomics_runtime/runs/failure_reports.py +132 -0
- bijux_proteomics_runtime/runs/import_lineage.py +238 -0
- bijux_proteomics_runtime/runs/integrity.py +221 -0
- bijux_proteomics_runtime/runs/launch_bundles.py +288 -0
- bijux_proteomics_runtime/runs/ledger.py +194 -0
- bijux_proteomics_runtime/runs/lifecycle.py +19 -0
- bijux_proteomics_runtime/runs/logging.py +81 -0
- bijux_proteomics_runtime/runs/manager.py +1662 -0
- bijux_proteomics_runtime/runs/operations.py +191 -0
- bijux_proteomics_runtime/runs/output.py +94 -0
- bijux_proteomics_runtime/runs/preflight.py +205 -0
- bijux_proteomics_runtime/runs/public.py +175 -0
- bijux_proteomics_runtime/runs/recovery.py +214 -0
- bijux_proteomics_runtime/runs/replay.py +172 -0
- bijux_proteomics_runtime/runs/replay_decisions.py +186 -0
- bijux_proteomics_runtime/runs/request.py +17 -0
- bijux_proteomics_runtime/runs/reruns.py +249 -0
- bijux_proteomics_runtime/runs/run_config.py +163 -0
- bijux_proteomics_runtime/runs/state_machine.py +42 -0
- bijux_proteomics_runtime/runs/telemetry.py +82 -0
- bijux_proteomics_runtime/runs/tool_reliability.py +64 -0
- bijux_proteomics_runtime/state/__init__.py +22 -0
- bijux_proteomics_runtime/state/memory_records.py +80 -0
- bijux_proteomics_runtime/state/memory_store.py +26 -0
- bijux_proteomics_runtime/state/schemas.py +75 -0
- bijux_proteomics_runtime/state/snapshot.py +88 -0
- bijux_proteomics_runtime/streaming/__init__.py +26 -0
- bijux_proteomics_runtime/streaming/execution.py +268 -0
- bijux_proteomics_runtime/support/__init__.py +12 -0
- bijux_proteomics_runtime/support/artifact_formats.py +127 -0
- bijux_proteomics_runtime/support/identity.py +25 -0
- bijux_proteomics_runtime/support/primitives/__init__.py +42 -0
- bijux_proteomics_runtime/support/primitives/api_lock.py +31 -0
- bijux_proteomics_runtime/support/primitives/contracts.py +16 -0
- bijux_proteomics_runtime/support/primitives/costs.py +23 -0
- bijux_proteomics_runtime/support/primitives/decisions.py +69 -0
- bijux_proteomics_runtime/support/primitives/determinism.py +20 -0
- bijux_proteomics_runtime/support/primitives/execution.py +124 -0
- bijux_proteomics_runtime/support/primitives/failures.py +55 -0
- bijux_proteomics_runtime/support/primitives/fingerprints.py +21 -0
- bijux_proteomics_runtime/support/primitives/hashing.py +13 -0
- bijux_proteomics_runtime/support/primitives/identifiers.py +15 -0
- bijux_proteomics_runtime/support/primitives/observations.py +113 -0
- bijux_proteomics_runtime/support/primitives/stability.py +75 -0
- bijux_proteomics_runtime/support/primitives/status.py +43 -0
- bijux_proteomics_runtime/support/primitives/surface_area.py +49 -0
- bijux_proteomics_runtime/support/primitives/tooling.py +156 -0
- bijux_proteomics_runtime/support/workspace.py +275 -0
- bijux_proteomics_runtime/workflows/__init__.py +8 -0
- bijux_proteomics_runtime/workflows/acceptance.py +341 -0
- bijux_proteomics_runtime/workflows/advanced_diann.py +1465 -0
- bijux_proteomics_runtime/workflows/advanced_diann_archive.py +125 -0
- bijux_proteomics_runtime/workflows/advanced_diann_comparison.py +293 -0
- bijux_proteomics_runtime/workflows/advanced_diann_comparison_models.py +122 -0
- bijux_proteomics_runtime/workflows/architecture_demo.py +346 -0
- bijux_proteomics_runtime/workflows/assurance.py +387 -0
- bijux_proteomics_runtime/workflows/benchmark_runs.py +1547 -0
- bijux_proteomics_runtime/workflows/black_box_reproducibility.py +587 -0
- bijux_proteomics_runtime/workflows/failure_reports.py +93 -0
- bijux_proteomics_runtime/workflows/flagship_runs.py +992 -0
- bijux_proteomics_runtime/workflows/flagship_workflow_chain.py +461 -0
- bijux_proteomics_runtime/workflows/flagship_workflow_manifest.py +422 -0
- bijux_proteomics_runtime/workflows/handoffs.py +215 -0
- bijux_proteomics_runtime/workflows/package_smoke.py +141 -0
- bijux_proteomics_runtime/workflows/packets.py +131 -0
- bijux_proteomics_runtime/workflows/paths.py +420 -0
- bijux_proteomics_runtime/workflows/plans.py +4092 -0
- bijux_proteomics_runtime/workflows/proof_accounting.py +566 -0
- bijux_proteomics_runtime/workflows/proof_classes.py +19 -0
- bijux_proteomics_runtime/workflows/public.py +827 -0
- bijux_proteomics_runtime/workflows/reproducibility.py +1031 -0
- bijux_proteomics_runtime/workflows/runs.py +1828 -0
- bijux_proteomics_runtime-0.3.8.dist-info/METADATA +440 -0
- bijux_proteomics_runtime-0.3.8.dist-info/RECORD +196 -0
- bijux_proteomics_runtime-0.3.8.dist-info/WHEEL +4 -0
- bijux_proteomics_runtime-0.3.8.dist-info/entry_points.txt +2 -0
- bijux_proteomics_runtime-0.3.8.dist-info/licenses/LICENSE +192 -0
- bijux_proteomics_runtime-0.3.8.dist-info/licenses/NOTICE +3 -0
LICENSE
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
Copyright 2026 Bijan Mousavi <bijan@bijux.io>
|
|
181
|
+
|
|
182
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
183
|
+
you may not use this file except in compliance with the License.
|
|
184
|
+
You may obtain a copy of the License at
|
|
185
|
+
|
|
186
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
187
|
+
|
|
188
|
+
Unless required by applicable law or agreed to in writing, software
|
|
189
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
190
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
191
|
+
See the License for the specific language governing permissions and
|
|
192
|
+
limitations under the License.
|
NOTICE
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Canonical runtime package for bijux proteomics execution surfaces."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib import import_module
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
__all__ = ["AppConfig", "RunManager", "cli", "create_app"]
|
|
9
|
+
|
|
10
|
+
_RUNTIME_ROOT_EXPORTS = {
|
|
11
|
+
"AppConfig": ("bijux_proteomics_runtime.api", "AppConfig"),
|
|
12
|
+
"RunManager": ("bijux_proteomics_runtime.runs.manager", "RunManager"),
|
|
13
|
+
"cli": ("bijux_proteomics_runtime.api.cli", "cli"),
|
|
14
|
+
"create_app": ("bijux_proteomics_runtime.api", "create_app"),
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def __getattr__(name: str) -> Any:
|
|
19
|
+
"""Load public runtime entrypoints lazily to avoid package-import cycles."""
|
|
20
|
+
|
|
21
|
+
target = _RUNTIME_ROOT_EXPORTS.get(name)
|
|
22
|
+
if target is None:
|
|
23
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
24
|
+
module_name, attribute_name = target
|
|
25
|
+
module = import_module(module_name)
|
|
26
|
+
return getattr(module, attribute_name)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# Copyright © 2025 Bijan Mousavi
|
|
3
|
+
|
|
4
|
+
"""HTTP API entry points."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from bijux_proteomics_runtime.api.public import (
|
|
9
|
+
__all__ as __all__,
|
|
10
|
+
)
|
|
11
|
+
from bijux_proteomics_runtime.api.public import (
|
|
12
|
+
__getattr__ as __getattr__,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
__stability__ = "stable"
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# Copyright © 2025 Bijan Mousavi
|
|
3
|
+
|
|
4
|
+
"""FastAPI app factory."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from collections.abc import Awaitable, Callable, Iterable
|
|
9
|
+
from dataclasses import dataclass
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from re import Pattern
|
|
12
|
+
|
|
13
|
+
from fastapi import FastAPI, HTTPException, Request, Response, status
|
|
14
|
+
from fastapi.exceptions import RequestValidationError
|
|
15
|
+
from fastapi.responses import JSONResponse
|
|
16
|
+
from starlette.exceptions import HTTPException as StarletteHTTPException
|
|
17
|
+
from starlette.routing import Match
|
|
18
|
+
|
|
19
|
+
from bijux_proteomics_runtime.api.errors import (
|
|
20
|
+
ApiError,
|
|
21
|
+
http_error,
|
|
22
|
+
method_not_allowed,
|
|
23
|
+
ok_envelope,
|
|
24
|
+
validation_error,
|
|
25
|
+
)
|
|
26
|
+
from bijux_proteomics_runtime.api.request_logging import (
|
|
27
|
+
RequestIdMiddleware,
|
|
28
|
+
RequestLogMiddleware,
|
|
29
|
+
)
|
|
30
|
+
from bijux_proteomics_runtime.api.v1.router import router as v1_router
|
|
31
|
+
from bijux_proteomics_runtime.api.v1.schema import ApiEnvelope
|
|
32
|
+
from bijux_proteomics_runtime.providers.catalog import (
|
|
33
|
+
provider_metadata,
|
|
34
|
+
provider_requirements,
|
|
35
|
+
)
|
|
36
|
+
from bijux_proteomics_runtime.runs.correlation import (
|
|
37
|
+
build_request_correlation_meta,
|
|
38
|
+
)
|
|
39
|
+
from bijux_proteomics_runtime.support.identity import (
|
|
40
|
+
runtime_banner,
|
|
41
|
+
runtime_description,
|
|
42
|
+
runtime_title,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _iter_method_guard_routes(app: FastAPI) -> Iterable[tuple[Pattern[str], set[str]]]:
|
|
47
|
+
"""Yield concrete HTTP route matchers for the custom method guard."""
|
|
48
|
+
|
|
49
|
+
for route in app.router.routes:
|
|
50
|
+
route_methods = _route_methods_for_guard(getattr(route, "methods", None))
|
|
51
|
+
path_regex = getattr(route, "path_regex", None)
|
|
52
|
+
if route_methods and path_regex is not None:
|
|
53
|
+
yield path_regex, route_methods
|
|
54
|
+
continue
|
|
55
|
+
effective_route_contexts = getattr(route, "effective_route_contexts", None)
|
|
56
|
+
if not callable(effective_route_contexts):
|
|
57
|
+
continue
|
|
58
|
+
for context in effective_route_contexts():
|
|
59
|
+
context_methods = _route_methods_for_guard(
|
|
60
|
+
getattr(context, "methods", None)
|
|
61
|
+
)
|
|
62
|
+
context_path_regex = getattr(context, "path_regex", None)
|
|
63
|
+
if context_methods and context_path_regex is not None:
|
|
64
|
+
yield context_path_regex, context_methods
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _route_methods_for_guard(candidate: object) -> set[str]:
|
|
68
|
+
"""Return a method set only when a route exposes concrete string methods."""
|
|
69
|
+
|
|
70
|
+
if not isinstance(candidate, (set, frozenset)):
|
|
71
|
+
return set()
|
|
72
|
+
if not all(isinstance(method, str) for method in candidate):
|
|
73
|
+
return set()
|
|
74
|
+
return set(candidate)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
@dataclass(frozen=True)
|
|
78
|
+
class AppConfig:
|
|
79
|
+
"""AppConfig."""
|
|
80
|
+
|
|
81
|
+
base_dir: Path
|
|
82
|
+
docs_enabled: bool = True
|
|
83
|
+
title: str = runtime_title()
|
|
84
|
+
description: str = runtime_description()
|
|
85
|
+
version: str = "2.0.0"
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def create_app(config: AppConfig) -> FastAPI:
|
|
89
|
+
"""Create a configured FastAPI app.
|
|
90
|
+
|
|
91
|
+
Inputs:
|
|
92
|
+
``config`` must provide the runtime base directory plus the app title,
|
|
93
|
+
description, version, and documentation toggle policy.
|
|
94
|
+
|
|
95
|
+
Outputs:
|
|
96
|
+
Returns one configured ``FastAPI`` application with runtime middleware,
|
|
97
|
+
exception handlers, provider metadata routes, and versioned API routers.
|
|
98
|
+
|
|
99
|
+
Failure Modes:
|
|
100
|
+
Propagates FastAPI router registration, middleware construction, and route
|
|
101
|
+
handler setup failures during application assembly.
|
|
102
|
+
|
|
103
|
+
Scientific Caveats:
|
|
104
|
+
This factory assembles transport and operator wiring only; it does not
|
|
105
|
+
validate scientific inputs or execute workflow algorithms at creation time.
|
|
106
|
+
"""
|
|
107
|
+
docs_url = "/docs" if config.docs_enabled else None
|
|
108
|
+
redoc_url = "/redoc" if config.docs_enabled else None
|
|
109
|
+
openapi_url = "/openapi.json" if config.docs_enabled else None
|
|
110
|
+
|
|
111
|
+
app = FastAPI(
|
|
112
|
+
title=config.title,
|
|
113
|
+
description=config.description,
|
|
114
|
+
version=config.version,
|
|
115
|
+
docs_url=docs_url,
|
|
116
|
+
redoc_url=redoc_url,
|
|
117
|
+
openapi_url=openapi_url,
|
|
118
|
+
)
|
|
119
|
+
app.state.base_dir = config.base_dir
|
|
120
|
+
|
|
121
|
+
app.add_middleware(RequestIdMiddleware)
|
|
122
|
+
app.add_middleware(RequestLogMiddleware)
|
|
123
|
+
|
|
124
|
+
@app.middleware("http")
|
|
125
|
+
async def _method_guard(
|
|
126
|
+
request: Request, call_next: Callable[[Request], Awaitable[Response]]
|
|
127
|
+
) -> Response:
|
|
128
|
+
"""Return 405 for unsupported methods on known routes."""
|
|
129
|
+
scope = request.scope
|
|
130
|
+
if scope.get("type") == "http":
|
|
131
|
+
request_path = scope.get("path")
|
|
132
|
+
matched = False
|
|
133
|
+
allowed_methods: set[str] = set()
|
|
134
|
+
if isinstance(request_path, str):
|
|
135
|
+
for path_regex, route_methods in _iter_method_guard_routes(app):
|
|
136
|
+
if path_regex.match(request_path) is not None:
|
|
137
|
+
matched = True
|
|
138
|
+
allowed_methods.update(route_methods)
|
|
139
|
+
else:
|
|
140
|
+
for route in app.router.routes:
|
|
141
|
+
match, _ = route.matches(scope)
|
|
142
|
+
if match in {Match.FULL, Match.PARTIAL}:
|
|
143
|
+
matched = True
|
|
144
|
+
route_methods = _route_methods_for_guard(
|
|
145
|
+
getattr(route, "methods", None)
|
|
146
|
+
)
|
|
147
|
+
if route_methods:
|
|
148
|
+
allowed_methods.update(route_methods)
|
|
149
|
+
if matched and request.method not in allowed_methods:
|
|
150
|
+
allow_header = ", ".join(sorted(allowed_methods))
|
|
151
|
+
meta = build_request_correlation_meta(
|
|
152
|
+
request,
|
|
153
|
+
"method-guard",
|
|
154
|
+
request.url.path,
|
|
155
|
+
)
|
|
156
|
+
payload = method_not_allowed(
|
|
157
|
+
f"Method {request.method} not allowed.",
|
|
158
|
+
str(request.url),
|
|
159
|
+
meta=meta,
|
|
160
|
+
)
|
|
161
|
+
return JSONResponse(
|
|
162
|
+
status_code=status.HTTP_405_METHOD_NOT_ALLOWED,
|
|
163
|
+
content=payload,
|
|
164
|
+
headers={"Allow": allow_header},
|
|
165
|
+
)
|
|
166
|
+
return await call_next(request)
|
|
167
|
+
|
|
168
|
+
@app.exception_handler(ApiError)
|
|
169
|
+
async def _handle_api_error(request: Request, exc: ApiError) -> JSONResponse:
|
|
170
|
+
"""_handle_api_error."""
|
|
171
|
+
return JSONResponse(status_code=exc.status_code, content=exc.payload)
|
|
172
|
+
|
|
173
|
+
@app.exception_handler(HTTPException)
|
|
174
|
+
async def _handle_http_exception(
|
|
175
|
+
request: Request, exc: HTTPException
|
|
176
|
+
) -> JSONResponse:
|
|
177
|
+
"""_handle_http_exception."""
|
|
178
|
+
payload = http_error(
|
|
179
|
+
exc.status_code,
|
|
180
|
+
str(exc.detail),
|
|
181
|
+
str(request.url),
|
|
182
|
+
meta=build_request_correlation_meta(
|
|
183
|
+
request, "http-error", request.url.path
|
|
184
|
+
),
|
|
185
|
+
)
|
|
186
|
+
return JSONResponse(status_code=exc.status_code, content=payload)
|
|
187
|
+
|
|
188
|
+
@app.exception_handler(StarletteHTTPException)
|
|
189
|
+
async def _handle_starlette_http_exception(
|
|
190
|
+
request: Request, exc: StarletteHTTPException
|
|
191
|
+
) -> JSONResponse:
|
|
192
|
+
"""_handle_starlette_http_exception."""
|
|
193
|
+
payload = http_error(
|
|
194
|
+
exc.status_code,
|
|
195
|
+
str(exc.detail),
|
|
196
|
+
str(request.url),
|
|
197
|
+
meta=build_request_correlation_meta(
|
|
198
|
+
request,
|
|
199
|
+
"starlette-http-error",
|
|
200
|
+
request.url.path,
|
|
201
|
+
),
|
|
202
|
+
)
|
|
203
|
+
return JSONResponse(status_code=exc.status_code, content=payload)
|
|
204
|
+
|
|
205
|
+
@app.exception_handler(RequestValidationError)
|
|
206
|
+
async def _handle_validation_error(
|
|
207
|
+
request: Request, exc: RequestValidationError
|
|
208
|
+
) -> JSONResponse:
|
|
209
|
+
"""_handle_validation_error."""
|
|
210
|
+
payload = validation_error(
|
|
211
|
+
str(exc),
|
|
212
|
+
str(request.url),
|
|
213
|
+
meta=build_request_correlation_meta(
|
|
214
|
+
request,
|
|
215
|
+
"validation-error",
|
|
216
|
+
request.url.path,
|
|
217
|
+
),
|
|
218
|
+
)
|
|
219
|
+
return JSONResponse(
|
|
220
|
+
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT, content=payload
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
@app.get("/health", tags=["health"], response_model=ApiEnvelope)
|
|
224
|
+
@app.get("/api/v1/health", tags=["health"], response_model=ApiEnvelope)
|
|
225
|
+
def health(request: Request) -> dict[str, object]:
|
|
226
|
+
"""health."""
|
|
227
|
+
return ok_envelope(
|
|
228
|
+
{"status": "ok", "runtime": runtime_banner()},
|
|
229
|
+
meta=build_request_correlation_meta(request, "health", "/health"),
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
@app.get("/ready", tags=["health"], response_model=ApiEnvelope)
|
|
233
|
+
@app.get("/api/v1/ready", tags=["health"], response_model=ApiEnvelope)
|
|
234
|
+
def ready(request: Request) -> dict[str, object]:
|
|
235
|
+
"""ready."""
|
|
236
|
+
providers: dict[str, object] = {}
|
|
237
|
+
try:
|
|
238
|
+
for name in provider_metadata():
|
|
239
|
+
providers[name] = {
|
|
240
|
+
"requirements": provider_requirements(name),
|
|
241
|
+
}
|
|
242
|
+
status_value = "ok"
|
|
243
|
+
except Exception as exc: # noqa: BLE001
|
|
244
|
+
providers = {"error": [str(exc)]}
|
|
245
|
+
status_value = "degraded"
|
|
246
|
+
return ok_envelope(
|
|
247
|
+
{
|
|
248
|
+
"status": status_value,
|
|
249
|
+
"runtime": runtime_banner(),
|
|
250
|
+
"providers": providers,
|
|
251
|
+
},
|
|
252
|
+
meta=build_request_correlation_meta(request, "ready", "/ready"),
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
app.include_router(v1_router, prefix="/api/v1")
|
|
256
|
+
return app
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
app = create_app(AppConfig(base_dir=Path.cwd(), docs_enabled=True))
|