fsanyoto commited on
Commit
87cbc14
Β·
verified Β·
1 Parent(s): 4216949

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,6 +1,12 @@
1
  {
2
- "current": "v10 (43f8042)",
3
  "releases": [
 
 
 
 
 
 
4
  {
5
  "version": "v10",
6
  "sha": "43f8042",
 
1
  {
2
+ "current": "v11 (3126617)",
3
  "releases": [
4
+ {
5
+ "version": "v11",
6
+ "sha": "3126617",
7
+ "date": "2026-08-05",
8
+ "subject": "release v11"
9
+ },
10
  {
11
  "version": "v10",
12
  "sha": "43f8042",
VERSION CHANGED
@@ -1 +1 @@
1
- v10 (43f8042)
 
1
+ v11 (3126617)
api/routes_tables.py CHANGED
@@ -49,6 +49,23 @@ def _defn_or_refuse(session, table_key):
49
  return defn
50
 
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  def scoped_pool(session: Session, table_key: str):
53
  """`(pids, rows_src, fields_base, defn)` β€” THE USER-TABLE WALL, on its own.
54
 
@@ -60,10 +77,20 @@ def scoped_pool(session: Session, table_key: str):
60
  defn = _defn_or_refuse(session, table_key)
61
  fields_base = [dict(f) for f in (defn.get("fields") or [])]
62
  field_keys = {f["key"] for f in fields_base}
 
 
63
  rows_src = []
64
  for rid, row in (defn.get("rows") or {}).items():
65
  if not str(rid).isdigit():
66
  continue
 
 
 
 
 
 
 
 
67
  r = {k: v for k, v in (row or {}).items() if k in field_keys}
68
  r["pid"] = int(rid)
69
  rows_src.append(r)
 
49
  return defn
50
 
51
 
52
+ #: Tables whose ROWS ARE PER-USER (D-39, wave 22 C6's view half): a non-admin sees the rows
53
+ #: they created plus any row nobody owns; an admin sees the whole pool.
54
+ #:
55
+ #: β›” NAMED EXPLICITLY, NEVER INFERRED FROM A `created_by` COLUMN. Every automation-written
56
+ #: table carries one β€” a scraped table's rows say `automation` β€” so inferring the rule from the
57
+ #: column's presence would hide every scraped row from every non-admin, which is the same
58
+ #: silent-disappearance defect one table wide instead of one table narrow.
59
+ #:
60
+ #: ⚠ AN UNOWNED ROW STAYS VISIBLE TO EVERYONE, and that is deliberate rather than lax: rows
61
+ #: written before the ownership stamp existed (nurilab's 58 candidates, measured 2026-08-05)
62
+ #: belong to nobody, and a rule that hid them would delete a team's working set from their
63
+ #: screen on deploy day while reporting nothing. New rows carry their finder's name, so the
64
+ #: owner's ask β€” "each user only works with their own data" β€” holds going forward without a
65
+ #: migration that guesses who found what.
66
+ PER_USER_TABLES = ("ut_ig_candidates",)
67
+
68
+
69
  def scoped_pool(session: Session, table_key: str):
70
  """`(pids, rows_src, fields_base, defn)` β€” THE USER-TABLE WALL, on its own.
71
 
 
77
  defn = _defn_or_refuse(session, table_key)
78
  fields_base = [dict(f) for f in (defn.get("fields") or [])]
79
  field_keys = {f["key"] for f in fields_base}
80
+ per_user = str(table_key) in PER_USER_TABLES and not session.admin
81
+ me = str(session.uname or "").strip().lower()
82
  rows_src = []
83
  for rid, row in (defn.get("rows") or {}).items():
84
  if not str(rid).isdigit():
85
  continue
86
+ # D-39 (wave 22's C6 view half): on a PER-USER table a non-admin sees their own rows
87
+ # and nobody else's. `created_by` is read off the RAW row, never the field-filtered
88
+ # copy below β€” it is written by the engine as row data and is not always a declared
89
+ # column, so filtering the projection would silently stop filtering anything.
90
+ if per_user:
91
+ owner = str((row or {}).get("created_by") or "").strip().lower()
92
+ if owner and owner != me:
93
+ continue
94
  r = {k: v for k, v in (row or {}).items() if k in field_keys}
95
  r["pid"] = int(rid)
96
  rows_src.append(r)
platform/core/grid_events.py CHANGED
@@ -263,6 +263,44 @@ def _granted_views(ctx, uname):
263
  v['sharedRole'] = role
264
  v['owner'] = owner
265
  out[str(vid)] = v
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  return out
267
 
268
 
 
263
  v['sharedRole'] = role
264
  v['owner'] = owner
265
  out[str(vid)] = v
266
+
267
+ # ⭐ D-37 (2026-08-05) β€” THE FOLDER LEG. W20's R10 said "a folder share = its views ride
268
+ # along"; W21 wired the view kind only, so a granted folder was accepted, stored and listed
269
+ # under "Shared with me" while changing NOTHING on the receiver's screen. Two waves of a
270
+ # control that reported success and did nothing β€” the same defect class the view leg above
271
+ # was written to close, surviving in its sibling.
272
+ #
273
+ # ⚠ A DIRECT VIEW GRANT WINS over the folder it happens to sit in, and the ordering above is
274
+ # what implements that: the direct pass has already filled `out`, so the folder pass skips
275
+ # ids it finds there. The specific grant is the more deliberate statement of intent, and it
276
+ # may carry a DIFFERENT role β€” a folder shared read-only must not downgrade a view somebody
277
+ # was explicitly given edit on, nor upgrade one they were not.
278
+ try:
279
+ folder_ids = (shares.shared_with(uname, kind='folder', st=st) or {}).get('folder') or []
280
+ except Exception:
281
+ folder_ids = []
282
+ for fid in folder_ids:
283
+ found = tops.find_folder(fid) if hasattr(tops, 'find_folder') else None
284
+ if not found:
285
+ continue # a folder on another topic contributes nothing here
286
+ owner, folder, inside = found
287
+ if owner == uname:
288
+ continue
289
+ role = shares.role_for('folder', fid, uname, st=st)
290
+ if role not in ('view', 'edit'):
291
+ continue
292
+ for vid, view in inside.items():
293
+ if str(vid) in out:
294
+ continue
295
+ v = dict(view)
296
+ v['shared'] = True
297
+ v['sharedRole'] = role
298
+ v['owner'] = owner
299
+ # The folder's NAME rides so the client can group these together later; today it
300
+ # renders in the same "Shared with me" group the view leg feeds. Stamps live on the
301
+ # PROJECTION only and are never written back, exactly as above.
302
+ v['sharedFolder'] = str(folder.get('name') or '')[:80]
303
+ out[str(vid)] = v
304
  return out
305
 
306
 
platform/core/table_store.py CHANGED
@@ -141,6 +141,48 @@ class TableStore:
141
  return str(username), dict(v)
142
  return None
143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  # ---------------------------------------------------------------- read
145
  def workspace(self, username, consume_corrections=True):
146
  """One user's durable workspace: always the full three-strata shape."""
 
141
  return str(username), dict(v)
142
  return None
143
 
144
+ def find_folder(self, folder_id):
145
+ """`(owner_username, folder_row, {view_id: view})` for a VIEWS folder living in any
146
+ personal stratum, else None. `find_view`'s sibling, and here for the same reason.
147
+
148
+ ⭐ D-37 (wave 20's R10 remainder, closed 2026-08-05): the grant registry accepts kind
149
+ `folder` and has since wave 20, but only the VIEW kind was ever projected β€” so "share
150
+ this folder with Karen" recorded a row, listed under Shared with me, and put nothing on
151
+ Karen's screen. Projecting a folder means two lookups the view path does not need: WHO
152
+ owns it, and WHICH views are filed in it. Folder membership lives in the owner's
153
+ `itemFolders` map (item id -> folder id), never on the view record, so the views are
154
+ found by asking that map rather than by reading a list off the folder.
155
+
156
+ Views only (`folders['views']`): the cohort surface has its own store and its own
157
+ sharing question, and answering both here would make one function mean two things.
158
+ """
159
+ fid = str(folder_id or '').strip()
160
+ if not fid:
161
+ return None
162
+ try:
163
+ data = self._st.get(self.table_key) or {}
164
+ except Exception:
165
+ return None
166
+ for username, ws in data.items():
167
+ if username == SHARED_KEY or not isinstance(ws, dict):
168
+ continue
169
+ rows = (ws.get('folders') or {}).get('views') or []
170
+ hit = next((f for f in rows
171
+ if isinstance(f, dict) and str(f.get('id') or '') == fid), None)
172
+ if not hit:
173
+ continue
174
+ # ⚠ `itemFolders` IS KEYED BY SURFACE FIRST (`{'views': {itemId: folderId}, …}`) β€”
175
+ # reading item ids off the top level finds the surface names instead and matches
176
+ # nothing, so the projection silently returns an EMPTY folder and the feature looks
177
+ # exactly as broken as it was before the fix. Caught by this change's own gate,
178
+ # which is the entire argument for writing one.
179
+ placed = (ws.get('itemFolders') or {}).get('views') or {}
180
+ views = ws.get('views') or {}
181
+ inside = {str(vid): dict(v) for vid, v in views.items()
182
+ if isinstance(v, dict) and str(placed.get(str(vid)) or '') == fid}
183
+ return str(username), dict(hit), inside
184
+ return None
185
+
186
  # ---------------------------------------------------------------- read
187
  def workspace(self, username, consume_corrections=True):
188
  """One user's durable workspace: always the full three-strata shape."""