feat(observatory): admit canonical recorded replay
This commit is contained in:
@@ -386,7 +386,11 @@ def finalized_replayable_recording_ids() -> tuple[str, ...]:
|
||||
finalized: list[str] = []
|
||||
cursor: str | None = None
|
||||
while True:
|
||||
page = session_store.list_recent(limit=100, cursor=cursor)
|
||||
page = session_store.list_recent(
|
||||
limit=100,
|
||||
cursor=cursor,
|
||||
include_capability_projections=False,
|
||||
)
|
||||
finalized.extend(
|
||||
summary.session_id
|
||||
for summary in page.items
|
||||
|
||||
@@ -341,10 +341,16 @@ def build_session_router(
|
||||
limit: int = Query(default=20, ge=1, le=100),
|
||||
cursor: str | None = Query(default=None, max_length=128),
|
||||
scope: Literal["all", "source", "laboratory"] = "all",
|
||||
lab_contract: Literal["v1", "v2"] = "v1",
|
||||
) -> dict[str, Any]:
|
||||
try:
|
||||
_refresh_catalog(catalog_refresher)
|
||||
page = store.list_recent(limit=limit, cursor=cursor, scope=scope)
|
||||
page = store.list_recent(
|
||||
limit=limit,
|
||||
cursor=cursor,
|
||||
scope=scope,
|
||||
include_capability_projections=lab_contract == "v2",
|
||||
)
|
||||
return {
|
||||
"items": [
|
||||
{
|
||||
@@ -356,7 +362,15 @@ def build_session_router(
|
||||
"modalities": list(item.modalities),
|
||||
"duration_seconds": item.duration_seconds or 0.0,
|
||||
"replayable": item.replayable,
|
||||
**({"lab": item.lab.as_dict()} if item.lab is not None else {}),
|
||||
**(
|
||||
{
|
||||
"lab": item.lab.as_dict(
|
||||
include_replay_capability=lab_contract == "v2"
|
||||
)
|
||||
}
|
||||
if item.lab is not None
|
||||
else {}
|
||||
),
|
||||
**(
|
||||
{
|
||||
"preparation": _catalog_preparation_document(
|
||||
|
||||
Reference in New Issue
Block a user