fsanyoto commited on
Commit
db355ce
Β·
verified Β·
1 Parent(s): 7ab16d7

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,4 +1,4 @@
1
  {
2
- "current": "b88b7bd",
3
  "releases": []
4
  }
 
1
  {
2
+ "current": "70a2937",
3
  "releases": []
4
  }
VERSION CHANGED
@@ -1 +1 @@
1
- b88b7bd
 
1
+ 70a2937
api/amazon_relational.py CHANGED
@@ -533,22 +533,12 @@ def apply_plan(rt, built, username="amazon", today=None):
533
  def _apply_all(doc):
534
  doc = doc if isinstance(doc, dict) else {}
535
  not_stored.clear()
536
- cap = _odoo._ut().MAX_TABLES
537
  for key, label, fields, rows in plans:
538
- # β›” S66-T42/T43 (lead, observed live 2026-09-25): the store caps a tenant at MAX_TABLES
539
- # databases IN TOTAL and the Amazon connector now spawns about sixty. `_ensure_table_inplace`
540
- # raises at the cap, and because this is ONE atomic write, a single new table over the cap
541
- # refused EVERY Amazon table, so none would ever appear again. A table already stored
542
- # always updates; a NEW table is created only while there is room, in `TABLES` order
543
- # (the original seven first), and the rest are REPORTED by name (standing rule 1's second
544
- # half), never silently dropped. Their rows stay in the Amazon mirror.
545
- if key not in doc and len(doc) >= cap:
546
- reason = (f"{label} is not in this workspace yet because the workspace already holds "
547
- f"its maximum of {cap} databases. Its rows are kept in the Amazon mirror. "
548
- "Fix: exclude connector databases from that limit, or raise it.")
549
- not_stored[key] = reason
550
- written[key] = {"state": "not_stored", "reason": reason}
551
- continue
552
  # Corrected/removed measured joins retire their machine-owned old fields.
553
  # Preserve fields a person created or explicitly took over.
554
  current = doc.get(key) or {}
 
533
  def _apply_all(doc):
534
  doc = doc if isinstance(doc, dict) else {}
535
  not_stored.clear()
 
536
  for key, label, fields, rows in plans:
537
+ # ⭐⭐ D-3284 (owner ruling 2026-09-27): S66-T42/T43 created a NEW Amazon table only while
538
+ # the workspace had room under MAX_TABLES and reported the rest `not_stored`; ten Amazon
539
+ # databases stayed missing that way. Connector databases now take no MAX_TABLES slot
540
+ # (`user_tables.counts_toward_table_cap`), so every planned Amazon table is created.
541
+ # `not_stored` stays as bookkeeping: empty, it clears any earlier record.
 
 
 
 
 
 
 
 
 
542
  # Corrected/removed measured joins retire their machine-owned old fields.
543
  # Preserve fields a person created or explicitly took over.
544
  current = doc.get(key) or {}
api/odoo_relational.py CHANGED
@@ -3739,15 +3739,9 @@ def plan(cur, rt=None, connection_id=None, buckets=None):
3739
  continue
3740
  built[bucket] = reader(cur, excluded)
3741
  problems = []
3742
-
3743
- if rt is not None:
3744
- needed = [k for k in keys.values() if k not in existing]
3745
- if needed and len(existing) + len(needed) > ut.MAX_TABLES:
3746
- problems.append(
3747
- f"tenant holds {len(existing)} of MAX_TABLES={ut.MAX_TABLES} user tables and "
3748
- f"needs {len(needed)} more ({', '.join(needed)}) for connection "
3749
- f"{connection_id or 'default'}; refusing rather than creating "
3750
- f"part of a linked set")
3751
 
3752
  for bucket, _base, _label, _fields in tables:
3753
  key = keys[bucket]
@@ -3893,8 +3887,7 @@ def _shipment_problems(rows, existing, key):
3893
  if stored and len(rows) < stored * MAX_SHRINK:
3894
  problems.append(f"{key}: read returned {len(rows)} rows against {stored} stored; "
3895
  "preserved the prior database. Check Odoo read access and retry sync.")
3896
- if key not in existing and len(existing) >= ut.MAX_TABLES:
3897
- problems.append(f"{key}: tenant is at MAX_TABLES={ut.MAX_TABLES}; nothing created")
3898
  size = ut.rows_bytes(rows)
3899
  if size > ut.MAX_TABLE_BYTES:
3900
  problems.append(f"{key}: {size} bytes exceeds MAX_TABLE_BYTES={ut.MAX_TABLE_BYTES}; "
@@ -4122,10 +4115,8 @@ def _ensure_table_inplace(cur, key, label, fields, rows, username, stamp):
4122
  subject = table_subject_for(key)
4123
  table = cur.get(key)
4124
  if table is None:
4125
- if len(cur) >= ut.MAX_TABLES:
4126
- # ⚠ `ut_ensure` returns silently at this cap; a silent no-op here would report a
4127
- # successful refresh over a table that does not exist.
4128
- raise Refused(f"{key}: tenant is at MAX_TABLES={ut.MAX_TABLES}; nothing created")
4129
  # ⭐⭐ W33-T41 / item 12a β€” THE UNIQUENESS CHECK, ON THE LINE THAT MINTED THE DUPLICATE.
4130
  #
4131
  # β›” IT GUARDS **CREATION ONLY**, AND THAT IS THE WHOLE DESIGN, NOT A WEAKENING. This
@@ -4453,11 +4444,8 @@ def sync_discovered_models(rt, source_connection_id=None, namespace=None,
4453
  f"{choice['model']}: too large to store, served nowhere until read-through"
4454
  for choice in oversized]}
4455
  keys = [str(choice["key"]) for choice in selected]
4456
- missing = [key for key in keys if key not in existing]
4457
- if missing and len(existing) + len(missing) > ut.MAX_TABLES:
4458
- raise Refused(f"tenant holds {len(existing)} of MAX_TABLES={ut.MAX_TABLES} databases and "
4459
- f"needs {len(missing)} more enabled Odoo models; nothing was created")
4460
- source = (rt.odoo_source() if source_connection_id is None
4461
  else rt.odoo_source(source_connection_id))
4462
  if source is None:
4463
  raise Refused("the selected Odoo connection is unavailable, so no discovered model was read")
 
3739
  continue
3740
  built[bucket] = reader(cur, excluded)
3741
  problems = []
3742
+ # ⭐⭐ D-3284 (owner ruling 2026-09-27): connector databases take NO `MAX_TABLES` slot
3743
+ # (`user_tables.counts_toward_table_cap`), so the cap can no longer refuse, or half-spawn, a
3744
+ # linked set. The refusal that stood here counted every database, people's and connectors'.
 
 
 
 
 
 
3745
 
3746
  for bucket, _base, _label, _fields in tables:
3747
  key = keys[bucket]
 
3887
  if stored and len(rows) < stored * MAX_SHRINK:
3888
  problems.append(f"{key}: read returned {len(rows)} rows against {stored} stored; "
3889
  "preserved the prior database. Check Odoo read access and retry sync.")
3890
+ # D-3284: no MAX_TABLES check here; a connector database takes no slot.
 
3891
  size = ut.rows_bytes(rows)
3892
  if size > ut.MAX_TABLE_BYTES:
3893
  problems.append(f"{key}: {size} bytes exceeds MAX_TABLE_BYTES={ut.MAX_TABLE_BYTES}; "
 
4115
  subject = table_subject_for(key)
4116
  table = cur.get(key)
4117
  if table is None:
4118
+ # D-3284 (owner ruling 2026-09-27): every table this writer creates is a connector
4119
+ # database (Odoo, Meta, Amazon), and those take no MAX_TABLES slot, so no cap refusal here.
 
 
4120
  # ⭐⭐ W33-T41 / item 12a β€” THE UNIQUENESS CHECK, ON THE LINE THAT MINTED THE DUPLICATE.
4121
  #
4122
  # β›” IT GUARDS **CREATION ONLY**, AND THAT IS THE WHOLE DESIGN, NOT A WEAKENING. This
 
4444
  f"{choice['model']}: too large to store, served nowhere until read-through"
4445
  for choice in oversized]}
4446
  keys = [str(choice["key"]) for choice in selected]
4447
+ # D-3284: enabled Odoo models are connector databases and take no MAX_TABLES slot.
4448
+ source =(rt.odoo_source() if source_connection_id is None
 
 
 
4449
  else rt.odoo_source(source_connection_id))
4450
  if source is None:
4451
  raise Refused("the selected Odoo connection is unavailable, so no discovered model was read")
api/routes_tables.py CHANGED
@@ -2116,7 +2116,7 @@ def create_table(body: dict = Body(default=None),
2116
  if not key:
2117
  raise err(400, "refused",
2118
  f"could not create it. The name may be empty or this tenant already has "
2119
- f"{ut.MAX_TABLES} databases")
2120
  return {"key": key}
2121
 
2122
 
 
2116
  if not key:
2117
  raise err(400, "refused",
2118
  f"could not create it. The name may be empty or this tenant already has "
2119
+ f"{ut.MAX_TABLES} databases of its own (connected-source databases do not count)")
2120
  return {"key": key}
2121
 
2122
 
platform/core/user_tables.py CHANGED
@@ -278,6 +278,11 @@ def is_connected(table_key, st=None):
278
  table = all_defs(st).get(key) or {}
279
  if not table:
280
  return False
 
 
 
 
 
281
  if table.get('connected') is True:
282
  return True
283
  return (any(key.startswith(p) for p in _CONNECTED_PREFIXES)
@@ -285,6 +290,26 @@ def is_connected(table_key, st=None):
285
  and table.get('recordMode') == AUTOMATION_RECORD_MODE)
286
 
287
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
  #: ⭐⭐ W30-T31 (D-87) β€” table keys whose rows DO NOT LIVE HERE AT ALL.
289
  #:
290
  #: A subset of `_CONNECTED`, and the distinction is the whole ticket. *Connected* says where the
@@ -1807,7 +1832,7 @@ def create(label, username, fields=None, source=None, st=None, *, managed_by=Non
1807
  if not label:
1808
  return None
1809
  existing = all_tables(st)
1810
- if len(existing) >= MAX_TABLES:
1811
  return None
1812
  key = KEY_PREFIX + _slug(label)
1813
  from core import route_system
 
278
  table = all_defs(st).get(key) or {}
279
  if not table:
280
  return False
281
+ return _connected_definition(key, table)
282
+
283
+
284
+ def _connected_definition(key, table):
285
+ """`is_connected`'s answers 2 and 3, read off a definition the caller already holds."""
286
  if table.get('connected') is True:
287
  return True
288
  return (any(key.startswith(p) for p in _CONNECTED_PREFIXES)
 
290
  and table.get('recordMode') == AUTOMATION_RECORD_MODE)
291
 
292
 
293
+ def counts_toward_table_cap(table_key, definition=None):
294
+ """Does this database take one of the tenant's `MAX_TABLES` slots?
295
+
296
+ ⭐⭐ OWNER RULING 2026-09-27 (D-3284): CONNECTOR-OWNED DATABASES DO NOT. The cap bounds what
297
+ PEOPLE create. A connector spawns one database per report (Amazon alone about sixty), and
298
+ counting those hid ten Amazon databases behind the cap with their rows sitting unreachable in
299
+ the mirror. The same answers as `is_connected`, off a definition the caller holds, because a
300
+ spawn's updater holds the raw document rather than a store.
301
+ """
302
+ key = str(table_key or '').strip()
303
+ if key in _CONNECTED:
304
+ return False
305
+ return not _connected_definition(key, definition if isinstance(definition, dict) else {})
306
+
307
+
308
+ def capped_table_count(tables):
309
+ """How many `MAX_TABLES` slots `{key: definition}` uses. Connector databases take none."""
310
+ return sum(1 for k, d in (tables or {}).items() if counts_toward_table_cap(k, d))
311
+
312
+
313
  #: ⭐⭐ W30-T31 (D-87) β€” table keys whose rows DO NOT LIVE HERE AT ALL.
314
  #:
315
  #: A subset of `_CONNECTED`, and the distinction is the whole ticket. *Connected* says where the
 
1832
  if not label:
1833
  return None
1834
  existing = all_tables(st)
1835
+ if capped_table_count(existing) >= MAX_TABLES: # connector databases take no slot (D-3284)
1836
  return None
1837
  key = KEY_PREFIX + _slug(label)
1838
  from core import route_system
web/public/AIOS_DEPLOY_RECEIPT CHANGED
@@ -1 +1 @@
1
- 37295882018aa2a107c8632a8aa488ea29aa998415401fb94087db2e56f6a5f1
 
1
+ 8a2e2045b6d653c3f3661f179e9b2761daaaf06d8883926d6f2117e56776434b