sable-sphynx 0.7.0.dev0__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.
- sable_sphynx-0.7.0.dev0.dist-info/METADATA +152 -0
- sable_sphynx-0.7.0.dev0.dist-info/RECORD +174 -0
- sable_sphynx-0.7.0.dev0.dist-info/WHEEL +5 -0
- sable_sphynx-0.7.0.dev0.dist-info/top_level.txt +1 -0
- sphynx/__init__.py +469 -0
- sphynx/__init__.pyi +376 -0
- sphynx/_analytical_client.py +77 -0
- sphynx/_analytical_values.py +252 -0
- sphynx/_audit_client.py +173 -0
- sphynx/_comparison_adapters.py +113 -0
- sphynx/_componentized_full_rag.py +34 -0
- sphynx/_composed_pipeline.py +109 -0
- sphynx/_full_rag_grading.py +218 -0
- sphynx/_full_rag_trace.py +221 -0
- sphynx/_local_eval.py +268 -0
- sphynx/_pipeline_core.py +243 -0
- sphynx/_pr_client.py +237 -0
- sphynx/_rag_diagnostics_calibration.py +285 -0
- sphynx/_rag_diagnostics_catalog.py +39 -0
- sphynx/_rag_diagnostics_common.py +26 -0
- sphynx/_rag_diagnostics_contracts.py +186 -0
- sphynx/_rag_diagnostics_engine.py +243 -0
- sphynx/_rag_diagnostics_importers.py +242 -0
- sphynx/_rag_diagnostics_ranking.py +81 -0
- sphynx/_rag_diagnostics_semantic.py +325 -0
- sphynx/_rag_ranking.py +149 -0
- sphynx/_speech_benchmark_scoring.py +140 -0
- sphynx/_speech_benchmark_sources.py +275 -0
- sphynx/_speech_complete_scoring.py +218 -0
- sphynx/_speech_complete_source.py +118 -0
- sphynx/_speech_kido.py +294 -0
- sphynx/_speech_scoring.py +77 -0
- sphynx/_track_capture.py +213 -0
- sphynx/analytical_views.py +515 -0
- sphynx/assessment_contracts.py +378 -0
- sphynx/assessment_selection.py +57 -0
- sphynx/audit_access.py +245 -0
- sphynx/audit_contracts.py +204 -0
- sphynx/audit_requests.py +180 -0
- sphynx/authoring.py +188 -0
- sphynx/benchmarks.py +568 -0
- sphynx/candidates.py +62 -0
- sphynx/catalog.py +272 -0
- sphynx/chunking.py +372 -0
- sphynx/clickhouse_reader.py +169 -0
- sphynx/client.py +486 -0
- sphynx/comparison_core.py +149 -0
- sphynx/comparison_views.py +223 -0
- sphynx/components.py +1661 -0
- sphynx/contracts.py +514 -0
- sphynx/customer_rerank.py +299 -0
- sphynx/customer_retrieval.py +146 -0
- sphynx/data/benchmark-releases.v1.json +164 -0
- sphynx/data/public-benchmark-release.v1.json +354 -0
- sphynx/data/rag-diagnostics-synthetic.v1.json +6982 -0
- sphynx/data/rag-paper-references.v1.json +176 -0
- sphynx/data/rag-paper-schemas.v1.json +1069 -0
- sphynx/data/rag-rerank-v1.json +507 -0
- sphynx/dataset_catalog_data.py +1214 -0
- sphynx/dataset_readiness.py +138 -0
- sphynx/dataset_v3.py +999 -0
- sphynx/demo.py +130 -0
- sphynx/demo_candidates/__init__.py +1 -0
- sphynx/demo_candidates/dense.py +11 -0
- sphynx/demo_candidates/lexical.py +21 -0
- sphynx/diagnostics.py +207 -0
- sphynx/documentation.py +737 -0
- sphynx/documentation_candidate.py +939 -0
- sphynx/evals.py +538 -0
- sphynx/evaluation_protocols.py +124 -0
- sphynx/evaluator_bindings.py +370 -0
- sphynx/evidence.py +352 -0
- sphynx/execution_capabilities.py +109 -0
- sphynx/fast_search.py +285 -0
- sphynx/full_rag.py +341 -0
- sphynx/hosted/__init__.py +18 -0
- sphynx/hosted/benchmark_intake.py +218 -0
- sphynx/hosted/contracts.py +361 -0
- sphynx/hosted/model_admission.py +130 -0
- sphynx/hosted/model_artifacts.py +298 -0
- sphynx/hosted/model_contracts.py +63 -0
- sphynx/hosted/model_gcs.py +181 -0
- sphynx/hosted/model_history.py +84 -0
- sphynx/hosted/model_session.py +233 -0
- sphynx/hosted/public_suite.py +74 -0
- sphynx/hosted/registry.py +97 -0
- sphynx/hosted/revisions.py +126 -0
- sphynx/hosted/sandbox.py +105 -0
- sphynx/hosted/submission.py +287 -0
- sphynx/hosted_workflow.py +451 -0
- sphynx/http_transport.py +86 -0
- sphynx/integrated_rag.py +352 -0
- sphynx/integrated_workflow.py +552 -0
- sphynx/integration_contracts.py +474 -0
- sphynx/invocation.py +791 -0
- sphynx/invocation_candidates.py +392 -0
- sphynx/invocation_catalog_data.py +40 -0
- sphynx/learned_catalog_data.py +30 -0
- sphynx/learned_rerank.py +267 -0
- sphynx/legacy_full_rag.py +67 -0
- sphynx/lifecycle.py +885 -0
- sphynx/lifecycle_workflow.py +490 -0
- sphynx/metric_views.py +474 -0
- sphynx/metrics.py +282 -0
- sphynx/model_adapters.py +438 -0
- sphynx/model_catalog_data.py +30 -0
- sphynx/official_benchmarks.py +385 -0
- sphynx/packs.py +258 -0
- sphynx/pipeline.py +313 -0
- sphynx/pipeline_workflow.py +551 -0
- sphynx/pr_evaluations.py +560 -0
- sphynx/progress.py +89 -0
- sphynx/public_bundle.py +173 -0
- sphynx/public_eval.py +62 -0
- sphynx/public_rerank.py +355 -0
- sphynx/py.typed +0 -0
- sphynx/pytest_plugin.py +62 -0
- sphynx/question_robustness.py +437 -0
- sphynx/rag.py +329 -0
- sphynx/rag_diagnostics.py +309 -0
- sphynx/rag_papers/__init__.py +29 -0
- sphynx/rag_papers/__main__.py +45 -0
- sphynx/rag_papers/candidates.py +19 -0
- sphynx/rag_papers/contracts.py +282 -0
- sphynx/rag_papers/datasets.py +291 -0
- sphynx/rag_papers/experiments.py +116 -0
- sphynx/rag_papers/judges.py +308 -0
- sphynx/rag_papers/registry.py +33 -0
- sphynx/rag_papers/runner.py +176 -0
- sphynx/rag_papers/sable.py +135 -0
- sphynx/rag_papers/schemas.py +12 -0
- sphynx/rag_papers/scoring.py +249 -0
- sphynx/rag_papers/semantic.py +288 -0
- sphynx/rag_papers/trec.py +80 -0
- sphynx/recorded_scores.py +352 -0
- sphynx/records.py +124 -0
- sphynx/reflex_traces.py +193 -0
- sphynx/report_rendering.py +71 -0
- sphynx/rerank_family_contracts.py +150 -0
- sphynx/rerank_workflow.py +424 -0
- sphynx/research_candidate.py +190 -0
- sphynx/results.py +852 -0
- sphynx/retrieval.py +750 -0
- sphynx/retrieval_candidates.py +295 -0
- sphynx/retrieval_catalog_data.py +19 -0
- sphynx/retrieval_recordings.py +125 -0
- sphynx/reviewer_audit.py +266 -0
- sphynx/routing_policies.py +375 -0
- sphynx/runner.py +544 -0
- sphynx/sable_rerank.py +489 -0
- sphynx/score_reliability.py +393 -0
- sphynx/speech_benchmarks.py +204 -0
- sphynx/speech_campaigns.py +378 -0
- sphynx/speech_complete.py +236 -0
- sphynx/speech_contracts.py +225 -0
- sphynx/speech_evidence.py +429 -0
- sphynx/speech_listening.py +115 -0
- sphynx/speech_multilingual.py +71 -0
- sphynx/speech_tts.py +479 -0
- sphynx/sql/001_sync_v1.sql +30 -0
- sphynx/stage_contracts.py +199 -0
- sphynx/statistical_catalog_data.py +53 -0
- sphynx/statistical_rerank.py +232 -0
- sphynx/sync.py +797 -0
- sphynx/workbench.py +378 -0
- sphynx/workbench_catalog_data.py +13 -0
- sphynx/workbench_tracks.py +78 -0
- sphynx/workflow_async.py +197 -0
- sphynx/workflow_contracts.py +594 -0
- sphynx/workflow_decisions.py +211 -0
- sphynx/workflow_defaults.py +16 -0
- sphynx/workflow_extensions.py +212 -0
- sphynx/workflow_registry.py +513 -0
- sphynx/workflows.py +792 -0
sphynx/workflow_async.py
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"""Optional asynchronous workflow contracts, without execution or polling.
|
|
2
|
+
|
|
3
|
+
Backends own native status, authority, and record verification. A submission is
|
|
4
|
+
coordination work, not a Run. A pending grading pass is not a Report. Native
|
|
5
|
+
references remain opaque and are excluded from public snapshots.
|
|
6
|
+
"""
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from dataclasses import dataclass, field
|
|
10
|
+
from typing import Any, Mapping, Protocol, TYPE_CHECKING, runtime_checkable
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from .progress import ProgressView
|
|
14
|
+
|
|
15
|
+
from .workflow_contracts import (
|
|
16
|
+
AdmissionBinding, PlanBinding, ReferenceBinding, ResolvedBinding,
|
|
17
|
+
WorkflowContractError, _object, _optional_text, _text, _thaw,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass(frozen=True)
|
|
22
|
+
class SubmissionIntent:
|
|
23
|
+
"""Retain the recovery key and exact declared request before its first POST.
|
|
24
|
+
|
|
25
|
+
The key identifies one operation. Deliberate new runs need new keys. This
|
|
26
|
+
metadata does not authenticate source or grant submission permission.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
idempotency_key: str
|
|
30
|
+
request_identity: Mapping[str, Any]
|
|
31
|
+
|
|
32
|
+
def __post_init__(self) -> None:
|
|
33
|
+
_text(self.idempotency_key, "idempotency_key")
|
|
34
|
+
object.__setattr__(self, "request_identity", _object(self.request_identity, "request_identity"))
|
|
35
|
+
|
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
|
37
|
+
return {"idempotency_key": self.idempotency_key,
|
|
38
|
+
"request_identity": _thaw(self.request_identity)}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class SubmissionError(WorkflowContractError):
|
|
42
|
+
"""An unsuccessful submission attempt with its original recovery intent."""
|
|
43
|
+
|
|
44
|
+
def __init__(self, message: str, *, intent: SubmissionIntent, code: str = "submission_failed") -> None:
|
|
45
|
+
if not isinstance(intent, SubmissionIntent):
|
|
46
|
+
raise WorkflowContractError("submission error requires a SubmissionIntent")
|
|
47
|
+
_text(code, "code")
|
|
48
|
+
self.intent, self.code = intent, code
|
|
49
|
+
super().__init__(message)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _state(complete: bool, failed: bool, error_code: str | None, reason: str | None) -> None:
|
|
53
|
+
if type(complete) is not bool or type(failed) is not bool or (complete and failed):
|
|
54
|
+
raise WorkflowContractError("complete and failed must be separate boolean states")
|
|
55
|
+
_optional_text(error_code, "error_code")
|
|
56
|
+
_optional_text(reason, "reason")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@dataclass(frozen=True)
|
|
60
|
+
class SubmissionSnapshot:
|
|
61
|
+
"""Verified native coordination metadata, separate from captured records.
|
|
62
|
+
|
|
63
|
+
A reserved run/grading ID may appear before its evidence is ready. Backends
|
|
64
|
+
expose native_run/native_grading only when those references can be consumed
|
|
65
|
+
as a Run/Report. Complete execution must provide a native run reference.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
submission_id: str
|
|
69
|
+
status: str
|
|
70
|
+
idempotency_key: str
|
|
71
|
+
request_identity: Mapping[str, Any]
|
|
72
|
+
native_ref: Any = field(repr=False, compare=False)
|
|
73
|
+
run_id: str | None = None
|
|
74
|
+
grading_id: str | None = None
|
|
75
|
+
native_run: Any = field(default=None, repr=False, compare=False)
|
|
76
|
+
native_grading: Any = field(default=None, repr=False, compare=False)
|
|
77
|
+
complete: bool = False
|
|
78
|
+
failed: bool = False
|
|
79
|
+
error_code: str | None = None
|
|
80
|
+
reason: str | None = None
|
|
81
|
+
trust_tier: str = "unverified"
|
|
82
|
+
|
|
83
|
+
def __post_init__(self) -> None:
|
|
84
|
+
for name in ("submission_id", "status", "idempotency_key", "trust_tier"):
|
|
85
|
+
_text(getattr(self, name), name)
|
|
86
|
+
for name in ("run_id", "grading_id"):
|
|
87
|
+
_optional_text(getattr(self, name), name)
|
|
88
|
+
_state(self.complete, self.failed, self.error_code, self.reason)
|
|
89
|
+
if self.native_run is not None and self.run_id is None:
|
|
90
|
+
raise WorkflowContractError("native run reference requires its run identity")
|
|
91
|
+
if self.native_grading is not None and self.grading_id is None:
|
|
92
|
+
raise WorkflowContractError("native grading reference requires its grading identity")
|
|
93
|
+
if self.complete and self.native_run is None:
|
|
94
|
+
raise WorkflowContractError("complete submission must provide a native run reference")
|
|
95
|
+
object.__setattr__(self, "request_identity", _object(self.request_identity, "request_identity"))
|
|
96
|
+
|
|
97
|
+
@property
|
|
98
|
+
def terminal(self) -> bool:
|
|
99
|
+
return self.complete or self.failed
|
|
100
|
+
|
|
101
|
+
@property
|
|
102
|
+
def progress(self) -> ProgressView:
|
|
103
|
+
from .progress import _progress
|
|
104
|
+
return _progress('submission', self.status,
|
|
105
|
+
{'submission_id': self.submission_id, 'idempotency_key': self.idempotency_key,
|
|
106
|
+
'run_id': self.run_id, 'grading_id': self.grading_id}, terminal=self.terminal,
|
|
107
|
+
complete=self.complete, failed=self.failed)
|
|
108
|
+
|
|
109
|
+
def to_dict(self) -> dict[str, Any]:
|
|
110
|
+
return {"submission_id": self.submission_id, "status": self.status,
|
|
111
|
+
"idempotency_key": self.idempotency_key, "request_identity": _thaw(self.request_identity),
|
|
112
|
+
"run_id": self.run_id, "grading_id": self.grading_id,
|
|
113
|
+
"complete": self.complete, "failed": self.failed, "error_code": self.error_code,
|
|
114
|
+
"reason": self.reason, "trust_tier": self.trust_tier}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
@dataclass(frozen=True)
|
|
118
|
+
class GradingSnapshot:
|
|
119
|
+
"""Pending native grading handle and optional completed report reference."""
|
|
120
|
+
|
|
121
|
+
reference: ReferenceBinding
|
|
122
|
+
idempotency_key: str
|
|
123
|
+
request_identity: Mapping[str, Any]
|
|
124
|
+
native_ref: Any = field(repr=False, compare=False)
|
|
125
|
+
completed_ref: Any = field(default=None, repr=False, compare=False)
|
|
126
|
+
complete: bool = False
|
|
127
|
+
failed: bool = False
|
|
128
|
+
error_code: str | None = None
|
|
129
|
+
reason: str | None = None
|
|
130
|
+
|
|
131
|
+
def __post_init__(self) -> None:
|
|
132
|
+
if not isinstance(self.reference, ReferenceBinding) or self.reference.record_id is None:
|
|
133
|
+
raise WorkflowContractError("grading snapshot requires its native ReferenceBinding")
|
|
134
|
+
_text(self.idempotency_key, "idempotency_key")
|
|
135
|
+
_state(self.complete, self.failed, self.error_code, self.reason)
|
|
136
|
+
if self.complete != (self.completed_ref is not None):
|
|
137
|
+
raise WorkflowContractError("only complete grading can expose a completed reference")
|
|
138
|
+
object.__setattr__(self, "request_identity", _object(self.request_identity, "request_identity"))
|
|
139
|
+
|
|
140
|
+
@property
|
|
141
|
+
def grading_id(self) -> str:
|
|
142
|
+
assert self.reference.record_id is not None
|
|
143
|
+
return self.reference.record_id
|
|
144
|
+
|
|
145
|
+
@property
|
|
146
|
+
def run_id(self) -> str | None:
|
|
147
|
+
return self.reference.run_id
|
|
148
|
+
|
|
149
|
+
@property
|
|
150
|
+
def status(self) -> str:
|
|
151
|
+
return self.reference.status
|
|
152
|
+
|
|
153
|
+
@property
|
|
154
|
+
def trust_tier(self) -> str:
|
|
155
|
+
return self.reference.trust_tier
|
|
156
|
+
|
|
157
|
+
@property
|
|
158
|
+
def terminal(self) -> bool:
|
|
159
|
+
return self.complete or self.failed
|
|
160
|
+
|
|
161
|
+
@property
|
|
162
|
+
def progress(self) -> ProgressView:
|
|
163
|
+
from .progress import _progress
|
|
164
|
+
return _progress('grading', self.status,
|
|
165
|
+
{'grading_id': self.grading_id, 'run_id': self.run_id,
|
|
166
|
+
'idempotency_key': self.idempotency_key}, terminal=self.terminal,
|
|
167
|
+
complete=self.complete, failed=self.failed)
|
|
168
|
+
|
|
169
|
+
def to_dict(self) -> dict[str, Any]:
|
|
170
|
+
return {"grading_id": self.grading_id, "run_id": self.run_id,
|
|
171
|
+
"status": self.status, "trust_tier": self.trust_tier,
|
|
172
|
+
"idempotency_key": self.idempotency_key, "request_identity": _thaw(self.request_identity),
|
|
173
|
+
"complete": self.complete, "failed": self.failed,
|
|
174
|
+
"error_code": self.error_code, "reason": self.reason}
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
@runtime_checkable
|
|
178
|
+
class AsyncWorkflowBackend(Protocol):
|
|
179
|
+
"""Additive backend capability; old WorkflowBackend remains unchanged.
|
|
180
|
+
|
|
181
|
+
Submission and grading POSTs receive a key retained before the attempt.
|
|
182
|
+
Snapshot/refresh calls must never submit, execute, or start another grading
|
|
183
|
+
pass. Backends verify native record linkage before exposing ready refs.
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
def submit(self, plan: PlanBinding, resolved: ResolvedBinding,
|
|
187
|
+
admission: AdmissionBinding, idempotency_key: str) -> Any: ...
|
|
188
|
+
|
|
189
|
+
def submission_snapshot(self, native_ref: Any) -> SubmissionSnapshot: ...
|
|
190
|
+
|
|
191
|
+
def refresh_submission(self, native_ref: Any) -> Any: ...
|
|
192
|
+
|
|
193
|
+
def start_grading(self, native_run: Any, idempotency_key: str) -> Any: ...
|
|
194
|
+
|
|
195
|
+
def grading_snapshot(self, native_ref: Any) -> GradingSnapshot: ...
|
|
196
|
+
|
|
197
|
+
def refresh_grading(self, native_ref: Any) -> Any: ...
|