Deploy AIOS web (React glide grid + FastAPI slice)
Browse files- RELEASES.json +1 -1
- VERSION +1 -1
- api/routes_starred.py +14 -0
- platform/core/store_pg.py +39 -0
- platform/harness/runtime.py +13 -0
- web/public/AIOS_DEPLOY_RECEIPT +1 -1
RELEASES.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"current": "
|
| 3 |
"releases": [
|
| 4 |
{
|
| 5 |
"version": "v74",
|
|
|
|
| 1 |
{
|
| 2 |
+
"current": "13d42c6",
|
| 3 |
"releases": [
|
| 4 |
{
|
| 5 |
"version": "v74",
|
VERSION
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
13d42c6
|
api/routes_starred.py
CHANGED
|
@@ -157,6 +157,20 @@ def _view_docs(session, order):
|
|
| 157 |
continue # a module surface or a folder head, not a table at all
|
| 158 |
readable.append((key, ws_key))
|
| 159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
for offset in range(0, len(readable), VIEW_SCAN_WORKERS):
|
| 161 |
if time.perf_counter() - started > VIEW_SCAN_BUDGET_S:
|
| 162 |
unread.extend(key for key, _ in readable[offset:])
|
|
|
|
| 157 |
continue # a module surface or a folder head, not a table at all
|
| 158 |
readable.append((key, ws_key))
|
| 159 |
|
| 160 |
+
batch_reader = getattr(session.runtime, "get_projections", None)
|
| 161 |
+
if readable and callable(batch_reader):
|
| 162 |
+
try:
|
| 163 |
+
batch = batch_reader([ws_key for _key, ws_key in readable],
|
| 164 |
+
drop=("overlays", "fields"))
|
| 165 |
+
except Exception:
|
| 166 |
+
# One batch has one availability answer. Reporting every key as unread is honest;
|
| 167 |
+
# falling through to N retries would recreate the latency wall on an unhealthy store.
|
| 168 |
+
return {}, [key for key, _ws_key in readable]
|
| 169 |
+
if batch is not None:
|
| 170 |
+
for key, ws_key in readable:
|
| 171 |
+
docs[key] = batch.get(ws_key) or {}
|
| 172 |
+
return docs, unread
|
| 173 |
+
|
| 174 |
for offset in range(0, len(readable), VIEW_SCAN_WORKERS):
|
| 175 |
if time.perf_counter() - started > VIEW_SCAN_BUDGET_S:
|
| 176 |
unread.extend(key for key, _ in readable[offset:])
|
platform/core/store_pg.py
CHANGED
|
@@ -347,6 +347,41 @@ def get_projection(name, drop=(), tenant_slug=None):
|
|
| 347 |
return _hf._project(data, frozenset(drops))
|
| 348 |
|
| 349 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 350 |
def exists(name, tenant_slug=None):
|
| 351 |
"""True/False — and unlike the HF backend this is NEVER "True on uncertainty".
|
| 352 |
|
|
@@ -610,6 +645,10 @@ class PgStore:
|
|
| 610 |
"""
|
| 611 |
return get_projection(name, drop=drop, tenant_slug=self.tenant_slug)
|
| 612 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 613 |
def _read_strict(self, name):
|
| 614 |
"""Interface parity with the HF Store. There, `get` is lenient (swallows a transient
|
| 615 |
failure) and `_read_strict` opts out so a failed read ABORTS a read-modify-write instead
|
|
|
|
| 347 |
return _hf._project(data, frozenset(drops))
|
| 348 |
|
| 349 |
|
| 350 |
+
def _get_projections(names, drop=(), tenant_slug=None):
|
| 351 |
+
"""Several projected documents in one round trip, keyed by their requested store key.
|
| 352 |
+
|
| 353 |
+
Private on purpose: the public module interface is the backend-parity surface, while this is
|
| 354 |
+
an optimization exposed only by a bound ``PgStore`` handle. Callers must retain a per-key
|
| 355 |
+
fallback for stores that do not offer it.
|
| 356 |
+
"""
|
| 357 |
+
import core.store as _hf # noqa: PLC0415 — projection shape lives with Store
|
| 358 |
+
|
| 359 |
+
keys = list(dict.fromkeys(str(name) for name in (names or ()) if str(name)))
|
| 360 |
+
if not keys:
|
| 361 |
+
return {}
|
| 362 |
+
drops = tuple(str(d) for d in drop)
|
| 363 |
+
with _pool().connection() as con:
|
| 364 |
+
rows = con.execute(
|
| 365 |
+
_q('SELECT kv.key, CASE '
|
| 366 |
+
"WHEN jsonb_typeof(kv.value) = 'object' THEN "
|
| 367 |
+
"COALESCE((SELECT jsonb_object_agg(e.entry_key, "
|
| 368 |
+
"CASE WHEN jsonb_typeof(e.entry_value) = 'object' "
|
| 369 |
+
'THEN e.entry_value - %s::text[] ELSE e.entry_value END) '
|
| 370 |
+
'FROM jsonb_each(kv.value) AS e(entry_key, entry_value)), '
|
| 371 |
+
"'{{}}'::jsonb) ELSE kv.value END FROM {tbl} AS kv "
|
| 372 |
+
'WHERE kv.key = ANY(%s::text[])', 'store_kv', tenant_slug),
|
| 373 |
+
(list(drops), keys)).fetchall()
|
| 374 |
+
found = {str(key): value for key, value in rows}
|
| 375 |
+
dropped = frozenset(drops)
|
| 376 |
+
return {
|
| 377 |
+
key: _hf._project(
|
| 378 |
+
dict(found[key]) if isinstance(found.get(key), dict)
|
| 379 |
+
else (found[key] if key in found else {}),
|
| 380 |
+
dropped)
|
| 381 |
+
for key in keys
|
| 382 |
+
}
|
| 383 |
+
|
| 384 |
+
|
| 385 |
def exists(name, tenant_slug=None):
|
| 386 |
"""True/False — and unlike the HF backend this is NEVER "True on uncertainty".
|
| 387 |
|
|
|
|
| 645 |
"""
|
| 646 |
return get_projection(name, drop=drop, tenant_slug=self.tenant_slug)
|
| 647 |
|
| 648 |
+
def get_projections(self, names, drop=()):
|
| 649 |
+
"""Bound batch projection; absent keys keep the single-read empty-document shape."""
|
| 650 |
+
return _get_projections(names, drop=drop, tenant_slug=self.tenant_slug)
|
| 651 |
+
|
| 652 |
def _read_strict(self, name):
|
| 653 |
"""Interface parity with the HF Store. There, `get` is lenient (swallows a transient
|
| 654 |
failure) and `_read_strict` opts out so a failed read ABORTS a read-modify-write instead
|
platform/harness/runtime.py
CHANGED
|
@@ -181,6 +181,19 @@ class TenantRuntime:
|
|
| 181 |
"""
|
| 182 |
return self._store().get_projection(self.store_key(name), drop=drop)
|
| 183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
def revision(self, name):
|
| 185 |
"""Return the tiny durable change token for this tenant's addressed bucket."""
|
| 186 |
return self._store().revision(self.store_key(name))
|
|
|
|
| 181 |
"""
|
| 182 |
return self._store().get_projection(self.store_key(name), drop=drop)
|
| 183 |
|
| 184 |
+
def get_projections(self, names, drop=()):
|
| 185 |
+
"""Batch projected reads when the active bound store has a native batch operation.
|
| 186 |
+
|
| 187 |
+
``None`` means the backend has no batch primitive; callers retain their ordinary per-key
|
| 188 |
+
path. That keeps this an optional optimization rather than widening the store contract.
|
| 189 |
+
"""
|
| 190 |
+
reader = getattr(self._store(), "get_projections", None)
|
| 191 |
+
if not callable(reader):
|
| 192 |
+
return None
|
| 193 |
+
keyed = [(str(name), self.store_key(name)) for name in (names or ())]
|
| 194 |
+
answer = reader([store_key for _name, store_key in keyed], drop=drop)
|
| 195 |
+
return {name: answer.get(store_key, {}) for name, store_key in keyed}
|
| 196 |
+
|
| 197 |
def revision(self, name):
|
| 198 |
"""Return the tiny durable change token for this tenant's addressed bucket."""
|
| 199 |
return self._store().revision(self.store_key(name))
|
web/public/AIOS_DEPLOY_RECEIPT
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
a91d8e0a2e6761df36b5d34b7a7261677256dfb78b28785903bc70f5e688994c
|