fsanyoto commited on
Commit
4e9a1c2
Β·
verified Β·
1 Parent(s): 39a9177

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
Files changed (3) hide show
  1. RELEASES.json +1 -1
  2. VERSION +1 -1
  3. api/routes_connected_tables.py +76 -63
RELEASES.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "current": "3c72c5b",
3
  "releases": [
4
  {
5
  "version": "v70",
 
1
  {
2
+ "current": "4da0f5e",
3
  "releases": [
4
  {
5
  "version": "v70",
VERSION CHANGED
@@ -1 +1 @@
1
- 3c72c5b
 
1
+ 4da0f5e
api/routes_connected_tables.py CHANGED
@@ -1,63 +1,76 @@
1
- """routes_connected_tables.py β€” the SOURCE-NEUTRAL door to a connected grid (W31-T49, contract C4).
2
-
3
- `GET /api/v1/connected-tables/{table_key}/rows` β€” one window over any grid whose rows come from a
4
- connector and are read THROUGH the per-tenant DuckDB mirror rather than copied into the tenant
5
- document. Odoo's four locked databases and its two line grains today; Meta Ads' entity and Insights
6
- grids when `meta_relational` registers its specs (R2).
7
-
8
- ⭐ WHY THIS FILE EXISTS. The read-through window shipped in wave 30 inside `routes_odoo_tables.py`,
9
- Odoo-named down to the URL β€” `/api/v1/odoo-tables/{key}/rows`. R2 puts a SECOND connector on the
10
- same mirror, and a Meta campaign served from a URL with `odoo` in it is a name that lies to every
11
- reader of a network tab, a log line and a bug report. So the capability gets a name that describes
12
- what it IS.
13
-
14
- β›”β›” IT IS AN ALIAS, NOT A REIMPLEMENTATION, AND THAT IS THE WHOLE DESIGN. T49's `done-when` is
15
- *"the Odoo path behaves byte-identically, proven by an NC"*. There are two ways to make that true:
16
- write a second handler and test that the two agree, or have ONE handler behind two URLs. Only the
17
- second is true BY CONSTRUCTION β€” the first is true on the day it is written and drifts the first
18
- time somebody fixes a bug in one of them. Every request here lands in
19
- `routes_odoo_tables.odoo_table_rows`, unchanged, so the two doors cannot disagree without a line
20
- being deleted. [[one-question-two-normalizers]]
21
-
22
- ⚠ THE OLD URL STAYS, and that is not politeness to a client we control. `CustomerGrid`'s bridge,
23
- saved views and anything an operator has in a browser tab all name it; retiring it in the same wave
24
- that introduces the new one would turn a rename into an outage for a feature that is already
25
- half-proven (D-174). The Odoo-named route is kept as a deliberate alias with a stated retirement
26
- condition rather than as a leftover: it goes when nothing in `web/src` names it.
27
-
28
- β›” THE MOUNT IS THE POINT AND IT HAS BEEN MISSED BEFORE β€” three finished routers shipped 404-dead
29
- behind green gates in wave 23, and wave 28 proved a MOUNTED router can still be uncallable
30
- (`session.is_admin`, an attribute that does not exist, raising above the route's own `try`). So
31
- `verify_meta` both enumerates `main.app.routes` for this path AND calls it.
32
- """
33
- from fastapi import APIRouter, Depends, Query
34
-
35
- from deps import Session, require_session
36
-
37
- router = APIRouter(prefix="/api/v1")
38
-
39
-
40
- @router.get("/connected-tables/{table_key}/rows")
41
- def connected_table_rows(table_key: str,
42
- offset: int = Query(default=0, ge=0),
43
- limit: int = Query(default=0),
44
- filters: str = Query(default=None),
45
- filterConj: str = Query(default="and"),
46
- sorts: str = Query(default=None),
47
- search: str = Query(default=None),
48
- session: Session = Depends(require_session)):
49
- """ONE WINDOW over a connected grid β€” `{fields, rows, total, totalUnfiltered, offset, limit,
50
- limits, identity, recordsMutable}`, whichever connector the rows come from.
51
-
52
- β›” EVERY GUARANTEE IS INHERITED, NOT RESTATED, because the body below is one call. `total` is a
53
- `SELECT count(*)` and never `len(rows)`; the filter, sort and search resolve in SQL over the
54
- whole table; anything that cannot be answered is reported in `limits` with a cause and a
55
- recommendation (R6's second sentence); the permission wall is `_defn_or_refuse`; and the
56
- cross-tenant mirror guard (D-169) refuses with `409 cross_tenant_store` before a cursor is
57
- handed out. Documenting them again HERE would be a second statement of a contract that has one
58
- home β€” and the day the two drifted, this file would be the one that lied.
59
- """
60
- import routes_odoo_tables
61
- return routes_odoo_tables.odoo_table_rows(
62
- table_key, offset=offset, limit=limit, filters=filters, filterConj=filterConj,
63
- sorts=sorts, search=search, session=session)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """routes_connected_tables.py β€” the SOURCE-NEUTRAL door to a connected grid (W31-T49, contract C4).
2
+
3
+ `GET /api/v1/connected-tables/{table_key}/rows` β€” one window over any grid whose rows come from a
4
+ connector and are read THROUGH the per-tenant DuckDB mirror rather than copied into the tenant
5
+ document. Odoo's four locked databases and its two line grains today; Meta Ads' entity and Insights
6
+ grids when `meta_relational` registers its specs (R2).
7
+
8
+ ⭐ WHY THIS FILE EXISTS. The read-through window shipped in wave 30 inside `routes_odoo_tables.py`,
9
+ Odoo-named down to the URL β€” `/api/v1/odoo-tables/{key}/rows`. R2 puts a SECOND connector on the
10
+ same mirror, and a Meta campaign served from a URL with `odoo` in it is a name that lies to every
11
+ reader of a network tab, a log line and a bug report. So the capability gets a name that describes
12
+ what it IS.
13
+
14
+ β›”β›” IT IS AN ALIAS, NOT A REIMPLEMENTATION, AND THAT IS THE WHOLE DESIGN. T49's `done-when` is
15
+ *"the Odoo path behaves byte-identically, proven by an NC"*. There are two ways to make that true:
16
+ write a second handler and test that the two agree, or have ONE handler behind two URLs. Only the
17
+ second is true BY CONSTRUCTION β€” the first is true on the day it is written and drifts the first
18
+ time somebody fixes a bug in one of them. Every request here lands in
19
+ `routes_odoo_tables.odoo_table_rows`, unchanged, so the two doors cannot disagree without a line
20
+ being deleted. [[one-question-two-normalizers]]
21
+
22
+ ⚠ THE OLD URL STAYS, and that is not politeness to a client we control. `CustomerGrid`'s bridge,
23
+ saved views and anything an operator has in a browser tab all name it; retiring it in the same wave
24
+ that introduces the new one would turn a rename into an outage for a feature that is already
25
+ half-proven (D-174). The Odoo-named route is kept as a deliberate alias with a stated retirement
26
+ condition rather than as a leftover: it goes when nothing in `web/src` names it.
27
+
28
+ β›” THE MOUNT IS THE POINT AND IT HAS BEEN MISSED BEFORE β€” three finished routers shipped 404-dead
29
+ behind green gates in wave 23, and wave 28 proved a MOUNTED router can still be uncallable
30
+ (`session.is_admin`, an attribute that does not exist, raising above the route's own `try`). So
31
+ `verify_meta` both enumerates `main.app.routes` for this path AND calls it.
32
+ """
33
+ from fastapi import APIRouter, Depends, Query
34
+
35
+ from deps import Session, require_session
36
+
37
+ router = APIRouter(prefix="/api/v1")
38
+
39
+
40
+ @router.get("/connected-tables/{table_key}/rows")
41
+ def connected_table_rows(table_key: str,
42
+ offset: int = Query(default=0, ge=0),
43
+ limit: int = Query(default=0),
44
+ filters: str = Query(default=None),
45
+ filterConj: str = Query(default="and"),
46
+ sorts: str = Query(default=None),
47
+ search: str = Query(default=None),
48
+ related: str = Query(default=None),
49
+ session: Session = Depends(require_session)):
50
+ """ONE WINDOW over a connected grid β€” `{fields, rows, total, totalUnfiltered, offset, limit,
51
+ limits, identity, recordsMutable}`, whichever connector the rows come from.
52
+
53
+ β›” EVERY GUARANTEE IS INHERITED, NOT RESTATED, because the body below is one call. `total` is a
54
+ `SELECT count(*)` and never `len(rows)`; the filter, sort and search resolve in SQL over the
55
+ whole table; anything that cannot be answered is reported in `limits` with a cause and a
56
+ recommendation (R6's second sentence); the permission wall is `_defn_or_refuse`; and the
57
+ cross-tenant mirror guard (D-169) refuses with `409 cross_tenant_store` before a cursor is
58
+ handed out. Documenting them again HERE would be a second statement of a contract that has one
59
+ home β€” and the day the two drifted, this file would be the one that lied.
60
+ """
61
+ # β›”β›” `related` MUST BE FORWARDED, AND OMITTING IT DID NOT MERELY DROP THE PIN -- IT 400ed
62
+ # THE WHOLE DOOR. This body calls `odoo_table_rows` as a PLAIN PYTHON FUNCTION, so an argument
63
+ # left out does not become `None`: it becomes the `Query(default=None)` SENTINEL OBJECT that
64
+ # FastAPI would have replaced. W51-T05 added `related` to that signature, and its guard reads
65
+ # `related in (None, "", {})` then `isinstance(related, dict)` -- a `Query` instance is none of
66
+ # those, so every ordinary paged read of a connected table raised
67
+ # `400 bad_relation` on the merged tree. NINE `api_meta` legs, 480/480 -> 471/480.
68
+ # ⭐ NEITHER LANE COULD SEE IT. Lane A owned the new parameter and its own gates never call
69
+ # this door; `api_meta` owns this door and was green at the lane base. It exists only in the
70
+ # combination -- the wave-50 `api_scopes` shape [[a-cached-value-outruns-the-permission-wall]].
71
+ # ⚠ The harvest predicted the SMALLER version of this (lane A booked "connected_table_rows
72
+ # silently DROPS the param"); the measured consequence was a refusal, not a silent drop.
73
+ import routes_odoo_tables
74
+ return routes_odoo_tables.odoo_table_rows(
75
+ table_key, offset=offset, limit=limit, filters=filters, filterConj=filterConj,
76
+ sorts=sorts, search=search, related=related, session=session)