fsanyoto commited on
Commit
4df2e4a
·
verified ·
1 Parent(s): cb62e29

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,4 +1,4 @@
1
  {
2
- "current": "611999cf",
3
  "releases": []
4
  }
 
1
  {
2
+ "current": "cc252d7c",
3
  "releases": []
4
  }
VERSION CHANGED
@@ -1 +1 @@
1
- 611999cf
 
1
+ cc252d7c
api/application_registry.py CHANGED
@@ -606,8 +606,19 @@ def ensure_route_application(runtime, tenant):
606
  from core import route_system
607
 
608
  # list_routes() suppresses read errors; an unknown count must remain retryable at boot.
 
 
 
 
609
  try:
610
- route_doc = runtime.get(route_system.STORE_KEY)
 
 
 
 
 
 
 
611
  if route_doc is None:
612
  routes = []
613
  elif isinstance(route_doc, dict):
 
606
  from core import route_system
607
 
608
  # list_routes() suppresses read errors; an unknown count must remain retryable at boot.
609
+ # ⛔ D-260: `runtime.get` is the LENIENT display read. A failed hub read there answers {},
610
+ # which counted as 0 routes and wrote the one-shot marker as "no_routes", so a tenant WITH
611
+ # routes never got its App. Read STRICTLY (the timeseries_retirement._read door) so a failure
612
+ # raises into the retryable skip below. Only a double exposing no strict door reads via get.
613
  try:
614
+ strict = getattr(runtime, "_read_strict", None)
615
+ if callable(strict):
616
+ route_doc = strict(route_system.STORE_KEY)
617
+ elif callable(getattr(runtime, "_store", None)) and callable(
618
+ getattr(runtime, "store_key", None)):
619
+ route_doc = runtime._store()._read_strict(runtime.store_key(route_system.STORE_KEY))
620
+ else:
621
+ route_doc = runtime.get(route_system.STORE_KEY)
622
  if route_doc is None:
623
  routes = []
624
  elif isinstance(route_doc, dict):
api/main.py CHANGED
@@ -80,6 +80,8 @@ import routes_starred # noqa: E402 (wave 35 R4/C2/C3/C5 — the star; E's rout
80
  import routes_usage # noqa: E402 (wave 35 R9/C7 — the AI usage meter; E's router, E's line)
81
  import routes_feedback # noqa: E402 (wave 35 R8/C6 — feedback to the operator plane; E's router)
82
  import routes_agent_harness # noqa: E402 (wave 36 R8/C4 — the agent harness store; E's router)
 
 
83
  import routes_geo # noqa: E402 (wave 37 R14/A11 — the keyless map provider seam; D's router)
84
  from core import grid_events # noqa: E402
85
 
@@ -492,6 +494,8 @@ app.include_router(routes_feedback.router) # R8 / C6 — feedback to the oper
492
  # rather than lucky: a FastAPI path parameter never spans a `/`, so `/agents/{agent_id}` cannot
493
  # match `/agents/x/harness`. The two routers share a prefix and no route.
494
  app.include_router(routes_agent_harness.router) # R8 / C4 — versioned agent harness files
 
 
495
  # ⭐⭐ WAVE 37 (R14, amendment A11) — THE KEYLESS MAP PROVIDER SEAM, mounted on `ASK D-1` in the
496
  # same wave that created `routes_geo.py`. NINTH consecutive wave in which this block is the
497
  # artefact the protocol nearly loses, and the first in which the ask that carries it was itself
 
80
  import routes_usage # noqa: E402 (wave 35 R9/C7 — the AI usage meter; E's router, E's line)
81
  import routes_feedback # noqa: E402 (wave 35 R8/C6 — feedback to the operator plane; E's router)
82
  import routes_agent_harness # noqa: E402 (wave 36 R8/C4 — the agent harness store; E's router)
83
+ import routes_schedules # noqa: E402 (S68-T61 C19 - stored schedules and the signed one-minute tick)
84
+ import routes_tickets # noqa: E402 (S68-T63 C21 - the Tickets REST doors)
85
  import routes_geo # noqa: E402 (wave 37 R14/A11 — the keyless map provider seam; D's router)
86
  from core import grid_events # noqa: E402
87
 
 
494
  # rather than lucky: a FastAPI path parameter never spans a `/`, so `/agents/{agent_id}` cannot
495
  # match `/agents/x/harness`. The two routers share a prefix and no route.
496
  app.include_router(routes_agent_harness.router) # R8 / C4 — versioned agent harness files
497
+ app.include_router(routes_schedules.router)
498
+ app.include_router(routes_tickets.router)
499
  # ⭐⭐ WAVE 37 (R14, amendment A11) — THE KEYLESS MAP PROVIDER SEAM, mounted on `ASK D-1` in the
500
  # same wave that created `routes_geo.py`. NINTH consecutive wave in which this block is the
501
  # artefact the protocol nearly loses, and the first in which the ask that carries it was itself
api/routes_assets.py CHANGED
@@ -61,13 +61,21 @@ def application_access_context(session, databases, *, strict=False):
61
  continue
62
  topic = next((row for row in sem.topics().values()
63
  if isinstance(row, dict) and row.get("grid") == database), None)
64
- readable = bool(topic and perm_scope.may_read(
 
 
 
 
 
65
  session.user, database, st=session.runtime))
66
  if not readable:
67
  if strict:
68
  raise PermissionError("that database is not available")
69
  continue
70
  allowed.add(database)
 
 
 
71
  baseline = semantic_rt.topic_records(database, topic)
72
  records[database] = semantic_rt.load(session.runtime, baseline)
73
  return allowed, records
 
61
  continue
62
  topic = next((row for row in sem.topics().values()
63
  if isinstance(row, dict) and row.get("grid") == database), None)
64
+ # S68-T42 / CA-F1: a user table has no semantic topic, and `perm_scope.may_read` already
65
+ # answers it (creator, admin or a share grant). Refusing it left every App bound to a user
66
+ # table unopenable and undeletable (S67-T39 finding). It carries no governed records, so a
67
+ # semantic role binding on it still fails closed in `_governed_bindings`.
68
+ user_table = topic is None and database.startswith("ut_")
69
+ readable = bool((topic or user_table) and perm_scope.may_read(
70
  session.user, database, st=session.runtime))
71
  if not readable:
72
  if strict:
73
  raise PermissionError("that database is not available")
74
  continue
75
  allowed.add(database)
76
+ if user_table:
77
+ records[database] = {}
78
+ continue
79
  baseline = semantic_rt.topic_records(database, topic)
80
  records[database] = semantic_rt.load(session.runtime, baseline)
81
  return allowed, records
api/routes_customers.py CHANGED
@@ -452,7 +452,10 @@ def _wall_stamp(session, table_key):
452
  from core import perm_scope
453
  stamp = getattr(perm_scope, "wall_stamp", None)
454
  if callable(stamp):
455
- return stamp(session.tenant, session.uname, table_key)
 
 
 
456
  # Until C1 lands, every document read by the existing wall is tracked by the build.
457
  return json.dumps(session.user, sort_keys=True, separators=(",", ":"), default=str)
458
 
 
452
  from core import perm_scope
453
  stamp = getattr(perm_scope, "wall_stamp", None)
454
  if callable(stamp):
455
+ # The session's verified record, so the stamp never re-reads the global account registry.
456
+ user = getattr(session, "user", None)
457
+ return stamp(session.tenant, session.uname, table_key,
458
+ user=user if isinstance(user, dict) else None)
459
  # Until C1 lands, every document read by the existing wall is tracked by the build.
460
  return json.dumps(session.user, sort_keys=True, separators=(",", ":"), default=str)
461
 
api/routes_sheet.py CHANGED
@@ -85,6 +85,24 @@ def _require_database(session: Session, database) -> str:
85
  return key
86
 
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  def _mirror(session: Session):
89
  """`(cursor, spec, columns)` for one read-through database, or the refusal that names why.
90
 
@@ -521,6 +539,7 @@ def distinct_values(database: str, field: str = Query(...),
521
  if database not in known:
522
  raise err(404, "not_connected", f"{database} is not a connected database.")
523
  database = _require_database(session, database)
 
524
  wall = ((perm_scope.entry(session.user, database) or {}).get("filter")
525
  if perm_scope.row_scope_applies(session.user, database) else None)
526
  wall_nodes, wall_conj = _fe_parts(wall)
@@ -1197,6 +1216,7 @@ def _binding_scope_key(session: Session, database: str, binding: dict) -> str:
1197
  """
1198
  from core import sheets
1199
  import core.perm_scope as perm_scope
 
1200
  wall_tree = ((perm_scope.entry(session.user, database) or {}).get("filter")
1201
  if perm_scope.row_scope_applies(session.user, database) else None)
1202
  from core.sheet_binding import fingerprint
@@ -3489,6 +3509,7 @@ def _binding_related_query(session, database, entry, cur, spec, columns, *, fiel
3489
  "Choose a relationship whose join columns are available on the live connection.")
3490
 
3491
  map_join(local_key, database, spec, columns, "source")
 
3492
  wall = ((perm_scope.entry(session.user, target) or {}).get("filter")
3493
  if perm_scope.row_scope_applies(session.user, target) else None)
3494
  wall_nodes, wall_conj = _fe_parts(wall)
@@ -3620,6 +3641,7 @@ def _resolve_binding(session: Session, raw_binding, *, today=None, view_memo=Non
3620
  # stored view document, which is why the order can move at all.
3621
  # ⛔ WHAT MUST NOT MOVE IS THE WALL'S OWN CHECK. It subtracts the wall's columns from `cols`
3622
  # and refuses 409 when one is missing, so it still runs AFTER the mirror exists, below.
 
3623
  wall_tree = ((perm_scope.entry(session.user, database) or {}).get("filter")
3624
  if perm_scope.row_scope_applies(session.user, database) else None)
3625
  wall_nodes, wall_conj = _fe_parts(wall_tree)
@@ -4022,6 +4044,7 @@ def view_rows(workbook_id: str, body: object = Body(default=None),
4022
  "error": "view_field_unknown", "message": f"Field {key} is not available in this database."})
4023
 
4024
  # W62 C2: "Filter and sort apply to ALL rows BEFORE limit. total counts every matching row."
 
4025
  wall_tree = ((perm_scope.entry(session.user, database) or {}).get("filter")
4026
  if perm_scope.row_scope_applies(session.user, database) else None)
4027
  wall_nodes, wall_conj = _fe_parts(wall_tree)
@@ -4313,6 +4336,7 @@ def drill_cell(workbook_id: str, addr: str, tab: str | None = None,
4313
  # an empty filter the honest column set is EMPTY and only the id column is materialised.
4314
  # MEASURED on tenant #0's `customer_data` (3,673 records, 47 columns), warm, through this
4315
  # route: 8,437 ms, of which 6,137 ms was materialising columns no query here reads.
 
4316
  wall_tree = ((perm_scope.entry(session.user, database) or {}).get("filter")
4317
  if perm_scope.row_scope_applies(session.user, database) else None)
4318
  wall_nodes, wall_conj = _fe_parts(wall_tree)
 
85
  return key
86
 
87
 
88
+ def _refuse_unapplied_audience(session: Session, database) -> None:
89
+ """S68-T57 (C16) FAIL-CLOSED: a Sheet read never serves a database with a row audience.
90
+
91
+ A C16 recipient list lives beside the records, not in the mirror SQL a Sheet binding
92
+ compiles, so no Sheet door can apply it yet. Until one can, every reader is refused with the
93
+ reason rather than served every row. ADMINS TOO: S68-T57's done-when says an admin is NOT
94
+ exempt (the audience is the recipient list, R35 decides who is on it), so an admin read would
95
+ be the same leak. Undeclared databases are unchanged. An unreadable declaration counts as
96
+ declared (`audience_declared`), so this fails closed.
97
+ """
98
+ import core.perm_scope as perm_scope
99
+ if perm_scope.audience_declared(database, st=session.runtime):
100
+ raise err(409, "scope_not_applicable",
101
+ f"{database} has an audience rule that limits which records each person may "
102
+ "see, and a Sheet binding cannot apply that rule yet. Open the database from "
103
+ "the navigation, where the rule is applied, or ask an administrator.")
104
+
105
+
106
  def _mirror(session: Session):
107
  """`(cursor, spec, columns)` for one read-through database, or the refusal that names why.
108
 
 
539
  if database not in known:
540
  raise err(404, "not_connected", f"{database} is not a connected database.")
541
  database = _require_database(session, database)
542
+ _refuse_unapplied_audience(session, database)
543
  wall = ((perm_scope.entry(session.user, database) or {}).get("filter")
544
  if perm_scope.row_scope_applies(session.user, database) else None)
545
  wall_nodes, wall_conj = _fe_parts(wall)
 
1216
  """
1217
  from core import sheets
1218
  import core.perm_scope as perm_scope
1219
+ _refuse_unapplied_audience(session, database)
1220
  wall_tree = ((perm_scope.entry(session.user, database) or {}).get("filter")
1221
  if perm_scope.row_scope_applies(session.user, database) else None)
1222
  from core.sheet_binding import fingerprint
 
3509
  "Choose a relationship whose join columns are available on the live connection.")
3510
 
3511
  map_join(local_key, database, spec, columns, "source")
3512
+ _refuse_unapplied_audience(session, target)
3513
  wall = ((perm_scope.entry(session.user, target) or {}).get("filter")
3514
  if perm_scope.row_scope_applies(session.user, target) else None)
3515
  wall_nodes, wall_conj = _fe_parts(wall)
 
3641
  # stored view document, which is why the order can move at all.
3642
  # ⛔ WHAT MUST NOT MOVE IS THE WALL'S OWN CHECK. It subtracts the wall's columns from `cols`
3643
  # and refuses 409 when one is missing, so it still runs AFTER the mirror exists, below.
3644
+ _refuse_unapplied_audience(session, database)
3645
  wall_tree = ((perm_scope.entry(session.user, database) or {}).get("filter")
3646
  if perm_scope.row_scope_applies(session.user, database) else None)
3647
  wall_nodes, wall_conj = _fe_parts(wall_tree)
 
4044
  "error": "view_field_unknown", "message": f"Field {key} is not available in this database."})
4045
 
4046
  # W62 C2: "Filter and sort apply to ALL rows BEFORE limit. total counts every matching row."
4047
+ _refuse_unapplied_audience(session, database)
4048
  wall_tree = ((perm_scope.entry(session.user, database) or {}).get("filter")
4049
  if perm_scope.row_scope_applies(session.user, database) else None)
4050
  wall_nodes, wall_conj = _fe_parts(wall_tree)
 
4336
  # an empty filter the honest column set is EMPTY and only the id column is materialised.
4337
  # MEASURED on tenant #0's `customer_data` (3,673 records, 47 columns), warm, through this
4338
  # route: 8,437 ms, of which 6,137 ms was materialising columns no query here reads.
4339
+ _refuse_unapplied_audience(session, database)
4340
  wall_tree = ((perm_scope.entry(session.user, database) or {}).get("filter")
4341
  if perm_scope.row_scope_applies(session.user, database) else None)
4342
  wall_nodes, wall_conj = _fe_parts(wall_tree)
api/routes_tables.py CHANGED
@@ -411,7 +411,7 @@ def _defn_or_refuse(session, table_key, st=None, defs_only=False, scope_applied=
411
  import core.perm_scope as perm_scope
412
  if not perm_scope.may_read(session.user, table_key, st=st):
413
  raise err(403, "forbidden", "that database belongs to another user")
414
- if not scope_applied and perm_scope.wall_declared(session.user, table_key):
415
  # R6's second sentence: a limit that cannot be met is a SENTENCE naming the cause and a
416
  # fix, never a short answer — and here the short answer would be the WHOLE database.
417
  raise err(409, "scope_not_applied",
@@ -572,7 +572,8 @@ def scoped_pool(session: Session, table_key: str, st=None):
572
  raise err(409, "window_required", str(e))
573
  except RuntimeError as e:
574
  raise err(503, "store_not_ready", str(e))
575
- rows_src = perm_scope.apply_row_scope(rows_src, session.user, table_key, fields_base)
 
576
  return frozenset(r["pid"] for r in rows_src), rows_src, fields_base, defn
577
  rows_src = []
578
  for rid, row in (defn.get("rows") or {}).items():
@@ -590,7 +591,8 @@ def scoped_pool(session: Session, table_key: str, st=None):
590
  # than being ignored. Evaluated against the DECLARED contract (`fields_base`), which is what
591
  # `routes_admin._clean_perms` validates a stored filter against, so the two cannot disagree
592
  # about what a column is.
593
- rows_src = perm_scope.apply_row_scope(rows_src, session.user, table_key, fields_base)
 
594
  return frozenset(r["pid"] for r in rows_src), rows_src, fields_base, defn
595
 
596
 
@@ -857,7 +859,8 @@ def scoped_pids(session: Session, table_key: str, limits=None, st=None):
857
  try:
858
  rows = _read_through_rows(table_key, {f["key"] for f in fields_base},
859
  rt=session.runtime)
860
- rows = perm_scope.apply_row_scope(rows, session.user, table_key, fields_base)
 
861
  return frozenset(r["pid"] for r in rows), fields_base, defn
862
  except _too_big() as e:
863
  # ⛔ THE REFUSAL BECOMES AN ANSWER HERE, WHICH IT MUST NOT ON THE ROWS PATH. Turning
@@ -901,13 +904,13 @@ def scoped_pids(session: Session, table_key: str, limits=None, st=None):
901
  # Only a principal an administrator has actually row-scoped pays the pass, and for them the
902
  # alternative is not "cheaper" but "wrong".
903
  rows = whole.get("rows") or {}
904
- if not perm_scope.row_scope_applies(session.user, table_key):
905
  return frozenset(int(rid) for rid in rows if str(rid).isdigit()), fields_base, whole
906
  keys = {f["key"] for f in fields_base if f.get("key")}
907
  scoped = perm_scope.apply_row_scope(
908
  [{**{k: v for k, v in (row or {}).items() if k in keys}, "pid": int(rid)}
909
  for rid, row in rows.items() if str(rid).isdigit()],
910
- session.user, table_key, fields_base)
911
  return frozenset(r["pid"] for r in scoped), fields_base, whole
912
 
913
 
@@ -2412,6 +2415,14 @@ def table_rows(table_key: str, session: Session = Depends(require_session),
2412
  # honest answer for a table nothing limits — never an absent key, which a client cannot tell
2413
  # apart from an older server.
2414
  _report = _ut().limit_report(table_key, st=_lent)
 
 
 
 
 
 
 
 
2415
  # ⭐ C4 / D-138 — THE DOCUMENTS PRODUCER. Absent since EXIT-6 deleted `app.py`, which was the
2416
  # only thing that ever set this key; the write door never stopped working and every client
2417
  # half is complete, but all six `onDoc*` handlers read `payload?.docs ? … : undefined`, so a
@@ -2433,7 +2444,8 @@ def table_rows(table_key: str, session: Session = Depends(require_session),
2433
  "pulled_at": time.strftime("%Y-%m-%d %H:%M"),
2434
  "identity": {"pid": "pid"},
2435
  "scope": {"table": table_key, "rowCount": len(rows)},
2436
- "limits": ([_report] if _report else []) + linked_metric_limits(metric_refusals),
 
2437
  "recordsMutable": _ut().records_mutable(table_key, st=_lent)}
2438
 
2439
 
@@ -3084,7 +3096,7 @@ def delete_row(table_key: str, rid: str, session: Session = Depends(require_sess
3084
  # ⚠ Guarded on `row_scope_applies` so an unscoped account pays nothing: for them the pid set
3085
  # is every row and the question has one answer.
3086
  import core.perm_scope as _ps
3087
- if _ps.row_scope_applies(session.user, table_key):
3088
  _pids, _f, _d = scoped_pids(session, table_key)
3089
  if not str(rid).isdigit() or int(rid) not in _pids:
3090
  raise err(403, "out_of_scope", "that row is not in this database")
 
411
  import core.perm_scope as perm_scope
412
  if not perm_scope.may_read(session.user, table_key, st=st):
413
  raise err(403, "forbidden", "that database belongs to another user")
414
+ if not scope_applied and perm_scope.wall_declared(session.user, table_key, defn=defn):
415
  # R6's second sentence: a limit that cannot be met is a SENTENCE naming the cause and a
416
  # fix, never a short answer — and here the short answer would be the WHOLE database.
417
  raise err(409, "scope_not_applied",
 
572
  raise err(409, "window_required", str(e))
573
  except RuntimeError as e:
574
  raise err(503, "store_not_ready", str(e))
575
+ rows_src = perm_scope.apply_row_scope(rows_src, session.user, table_key, fields_base,
576
+ st=session.runtime, defn=defn)
577
  return frozenset(r["pid"] for r in rows_src), rows_src, fields_base, defn
578
  rows_src = []
579
  for rid, row in (defn.get("rows") or {}).items():
 
591
  # than being ignored. Evaluated against the DECLARED contract (`fields_base`), which is what
592
  # `routes_admin._clean_perms` validates a stored filter against, so the two cannot disagree
593
  # about what a column is.
594
+ rows_src = perm_scope.apply_row_scope(rows_src, session.user, table_key, fields_base,
595
+ st=session.runtime, defn=defn)
596
  return frozenset(r["pid"] for r in rows_src), rows_src, fields_base, defn
597
 
598
 
 
859
  try:
860
  rows = _read_through_rows(table_key, {f["key"] for f in fields_base},
861
  rt=session.runtime)
862
+ rows = perm_scope.apply_row_scope(rows, session.user, table_key, fields_base,
863
+ st=session.runtime, defn=defn)
864
  return frozenset(r["pid"] for r in rows), fields_base, defn
865
  except _too_big() as e:
866
  # ⛔ THE REFUSAL BECOMES AN ANSWER HERE, WHICH IT MUST NOT ON THE ROWS PATH. Turning
 
904
  # Only a principal an administrator has actually row-scoped pays the pass, and for them the
905
  # alternative is not "cheaper" but "wrong".
906
  rows = whole.get("rows") or {}
907
+ if not perm_scope.row_scope_applies(session.user, table_key, defn=whole):
908
  return frozenset(int(rid) for rid in rows if str(rid).isdigit()), fields_base, whole
909
  keys = {f["key"] for f in fields_base if f.get("key")}
910
  scoped = perm_scope.apply_row_scope(
911
  [{**{k: v for k, v in (row or {}).items() if k in keys}, "pid": int(rid)}
912
  for rid, row in rows.items() if str(rid).isdigit()],
913
+ session.user, table_key, fields_base, st=session.runtime, defn=whole)
914
  return frozenset(r["pid"] for r in scoped), fields_base, whole
915
 
916
 
 
2415
  # honest answer for a table nothing limits — never an absent key, which a client cannot tell
2416
  # apart from an older server.
2417
  _report = _ut().limit_report(table_key, st=_lent)
2418
+ # S68-T01 (COMBINE-AMEND): a wall that leaves this reader NO record is an empty grid WITH the
2419
+ # access sentence, never a bare empty grid a reader cannot tell from an empty database.
2420
+ import core.perm_scope as perm_scope
2421
+ _walled = [] if rows or not perm_scope.row_scope_applies(session.user, table_key) else [{
2422
+ "subject": "rows", "effect": "filtered",
2423
+ "cause": "an access rule an administrator set for your account matches no record in "
2424
+ "this database",
2425
+ "recommendation": "ask an administrator to review your access rule"}]
2426
  # ⭐ C4 / D-138 — THE DOCUMENTS PRODUCER. Absent since EXIT-6 deleted `app.py`, which was the
2427
  # only thing that ever set this key; the write door never stopped working and every client
2428
  # half is complete, but all six `onDoc*` handlers read `payload?.docs ? … : undefined`, so a
 
2444
  "pulled_at": time.strftime("%Y-%m-%d %H:%M"),
2445
  "identity": {"pid": "pid"},
2446
  "scope": {"table": table_key, "rowCount": len(rows)},
2447
+ "limits": (([_report] if _report else []) + linked_metric_limits(metric_refusals)
2448
+ + _walled),
2449
  "recordsMutable": _ut().records_mutable(table_key, st=_lent)}
2450
 
2451
 
 
3096
  # ⚠ Guarded on `row_scope_applies` so an unscoped account pays nothing: for them the pid set
3097
  # is every row and the question has one answer.
3098
  import core.perm_scope as _ps
3099
+ if _ps.row_scope_applies(session.user, table_key, st=session.runtime):
3100
  _pids, _f, _d = scoped_pids(session, table_key)
3101
  if not str(rid).isdigit() or int(rid) not in _pids:
3102
  raise err(403, "out_of_scope", "that row is not in this database")
platform/core/chart_system.py CHANGED
@@ -54,8 +54,10 @@ from datetime import datetime, timezone
54
  #: "listed independently of ws['views']" a fact about storage rather than a promise about code.
55
  STORE_KEY = "loopable_chart_system"
56
 
57
- #: This wave's only consumer. A DEFAULT, never a constraint: any slug is accepted.
58
- DEFAULT_KIND = "timeseries"
 
 
59
 
60
  _MAX_NAME = 120
61
  _MAX_KIND = 40
 
54
  #: "listed independently of ws['views']" a fact about storage rather than a promise about code.
55
  STORE_KEY = "loopable_chart_system"
56
 
57
+ #: A DEFAULT, never a constraint: any slug is accepted. ⛔ Never a retired kind: S68-T44 retired
58
+ #: `timeseries` and its boot purge deletes every chart of that kind (and every stored kind-less
59
+ #: one), so a kind-less chart written AFTER the purge must not be re-stamped as Time-series.
60
+ DEFAULT_KIND = "chart"
61
 
62
  _MAX_NAME = 120
63
  _MAX_KIND = 40
platform/core/external_tools.py CHANGED
@@ -416,6 +416,14 @@ TOOLS = {
416
  "fn": {"enum": ["count", "count_distinct", "sum", "avg", "min", "max"]},
417
  "field": _STRING,
418
  }, ("fn",), additionalProperties=False)},
 
 
 
 
 
 
 
 
419
  }, ("database",), additionalProperties=False),
420
  lambda ctx, args: ctx.query_database(args["database"], {
421
  key: value for key, value in args.items() if key != "database"
 
416
  "fn": {"enum": ["count", "count_distinct", "sum", "avg", "min", "max"]},
417
  "field": _STRING,
418
  }, ("fn",), additionalProperties=False)},
419
+ # S68-T55 (COMBINE-AMEND): the MCP door asks for the same SKU x month groups the REST
420
+ # door answers (`routes_external._normalise_query_groups`): 1 to 4 field keys, or a
421
+ # field with unit month.
422
+ "groupBy": {"type": "array", "minItems": 1, "maxItems": 4, "items": {"oneOf": [
423
+ _STRING,
424
+ _object({"field": _STRING, "unit": {"enum": ["month"]}}, ("field",),
425
+ additionalProperties=False),
426
+ ]}},
427
  }, ("database",), additionalProperties=False),
428
  lambda ctx, args: ctx.query_database(args["database"], {
429
  key: value for key, value in args.items() if key != "database"
platform/core/perm_scope.py CHANGED
@@ -988,13 +988,20 @@ def _wall_source_revisions(st, table_key, tree):
988
  return revisions
989
 
990
 
991
- def wall_stamp(tenant, username, table_key) -> str:
992
- """C1: rules plus derived-source revisions. Any uncertainty forces a cache miss."""
 
 
 
 
 
 
993
  try:
994
  import core.external_access as access
995
  tenant_key = str(tenant or '').strip().lower()
996
  owner = str(username or '').strip().lower()
997
- user = access.resolve_active_user(owner, tenant_key)
 
998
  st = access.runtime.get_runtime(tenant_key)
999
  wall = entry(user, table_key)
1000
  payload = {'tenant': tenant_key, 'username': owner, 'table': table_key,
 
988
  return revisions
989
 
990
 
991
+ def wall_stamp(tenant, username, table_key, *, user=None) -> str:
992
+ """C1: rules plus derived-source revisions. Any uncertainty forces a cache miss.
993
+
994
+ `user` is the record a verified session already holds (SDLC 68 combine). A session door
995
+ passes it so the stamp describes the wall this request applies WITHOUT a second read of the
996
+ global account registry: that read is tenant #0's `users` document, which a sandbox QA
997
+ identity must never touch (W39-T28). Without it the account is resolved as before.
998
+ """
999
  try:
1000
  import core.external_access as access
1001
  tenant_key = str(tenant or '').strip().lower()
1002
  owner = str(username or '').strip().lower()
1003
+ if not isinstance(user, dict):
1004
+ user = access.resolve_active_user(owner, tenant_key)
1005
  st = access.runtime.get_runtime(tenant_key)
1006
  wall = entry(user, table_key)
1007
  payload = {'tenant': tenant_key, 'username': owner, 'table': table_key,
platform/core/user_tables.py CHANGED
@@ -533,14 +533,14 @@ def limit_report(table_key, st=None):
533
  if cap == 0:
534
  return {
535
  'subject': 'rows', 'limit': 0, 'effect': 'read_through',
536
- 'cause': 'this database is served THROUGH the connector mirror, so its rows are '
537
  'never copied into this tenant document and no ceiling applies to them',
538
  'recommendation': 'read it with a window (`/odoo-tables/{key}/rows`); the row count '
539
  'you see there is a SQL count over the whole table',
540
  }
541
  return {
542
  'subject': 'rows', 'limit': cap, 'effect': 'refused',
543
- 'cause': f'this database is EDITABLE, so its rows live in the shared `{STORE_KEY}` '
544
  f'document that every request copies; at the widest shipped row (0.318 KB) '
545
  f'{cap:,} rows is 19.1 MB against a 32 MB per-table budget',
546
  'recommendation': 'connect it to a source instead. Connected data is served '
@@ -1632,7 +1632,7 @@ def get_one(table_key, st=None):
1632
  if reader is not None:
1633
  one = reader(STORE_KEY, str(table_key))
1634
  return one if isinstance(one, dict) else None
1635
- return get(table_key, st)
1636
 
1637
 
1638
  # --- DURABLE MAP ZONES -------------------------------------------------------
 
533
  if cap == 0:
534
  return {
535
  'subject': 'rows', 'limit': 0, 'effect': 'read_through',
536
+ 'cause': 'this database is served through the connector mirror, so its rows are '
537
  'never copied into this tenant document and no ceiling applies to them',
538
  'recommendation': 'read it with a window (`/odoo-tables/{key}/rows`); the row count '
539
  'you see there is a SQL count over the whole table',
540
  }
541
  return {
542
  'subject': 'rows', 'limit': cap, 'effect': 'refused',
543
+ 'cause': f'this database is editable, so its rows live in the shared `{STORE_KEY}` '
544
  f'document that every request copies; at the widest shipped row (0.318 KB) '
545
  f'{cap:,} rows is 19.1 MB against a 32 MB per-table budget',
546
  'recommendation': 'connect it to a source instead. Connected data is served '
 
1632
  if reader is not None:
1633
  one = reader(STORE_KEY, str(table_key))
1634
  return one if isinstance(one, dict) else None
1635
+ return get(table_key, st=st)
1636
 
1637
 
1638
  # --- DURABLE MAP ZONES -------------------------------------------------------
web/public/AIOS_DEPLOY_RECEIPT CHANGED
@@ -1 +1 @@
1
- 39e6a981dc53a702745d41d55bb6642dd2e734991ed346e49a25158fe690a256
 
1
+ d18fdd5343aecaacaf8ba93724074d9f9f0612a05424cebf53a531cd3c847718
web/src/customer-grid/CustomerGrid.tsx CHANGED
@@ -1738,6 +1738,15 @@ export interface CellDisplayChoice {
1738
  visible: string[];
1739
  }
1740
 
 
 
 
 
 
 
 
 
 
1741
  interface CustomerGridProps {
1742
  scope?: SurfaceScope;
1743
  /** Shell-owned Data workspace location; grid resolves its view/field, never the global rail. */
@@ -1763,6 +1772,7 @@ interface CustomerGridProps {
1763
  embeddedPayload?: CustomersPayload | null;
1764
  /** Exact linked pids to page on the server. */
1765
  embeddedRecordIds?: readonly number[];
 
1766
  onEmbeddedTotalChange?: (total: number | null) => void;
1767
  /** Selection mode used by an editable ordinary-Link modal. */
1768
  embeddedSelectable?: boolean;
@@ -1858,6 +1868,7 @@ interface LinkGridModalProps {
1858
  label: string;
1859
  table: SurfaceScope;
1860
  recordIds: readonly number[];
 
1861
  editable?: boolean;
1862
  single?: boolean;
1863
  excludeRecordId?: number;
@@ -1886,7 +1897,7 @@ interface LinkGridModalProps {
1886
  // chrome slots and a `cellView` modifier while leaving existing callers and the focus trap intact.
1887
  export function LinkGridModal({ label, table, recordIds, editable = false, single = false,
1888
  excludeRecordId, cellView = false, cellFilter, cellFields, onCellFilterChange, onCellDisplayChange,
1889
- headerActions, footer,
1890
  onOpenRecord, onSave, onClose }: LinkGridModalProps) {
1891
  const panelRef = useRef<HTMLDivElement>(null);
1892
  const [selectedIds, setSelectedIds] = useState<number[]>(() => [...recordIds]);
@@ -1954,6 +1965,7 @@ export function LinkGridModal({ label, table, recordIds, editable = false, singl
1954
  onCellFilterChange={onCellFilterChange}
1955
  onCellDisplayChange={onCellDisplayChange}
1956
  embeddedRecordIds={editable ? undefined : recordIds}
 
1957
  onEmbeddedTotalChange={editable ? undefined : reportTotal}
1958
  embeddedExcludeRecordId={editable ? excludeRecordId : undefined}
1959
  embeddedSelectable={editable}
@@ -2086,8 +2098,10 @@ function CustomerGrid(props: CustomerGridProps = {}) {
2086
 
2087
  /** An ID-backed grid supplies pages through the existing caller-owned payload seam. */
2088
  function useRecordIdWindow(scope: SurfaceScope, ids: readonly number[] | undefined,
2089
- related: RelatedPin | null) {
2090
- const key = JSON.stringify([scope, ids, related]);
 
 
2091
  const currentKey = useRef(key);
2092
  const sequence = useRef(0);
2093
  const lastRequest = useRef<RowWindowRequest | null>(null);
@@ -2099,20 +2113,31 @@ function useRecordIdWindow(scope: SurfaceScope, ids: readonly number[] | undefin
2099
  const [page, setPage] = useState<{
2100
  key: string; payload: CustomersPayload | null; pending: boolean;
2101
  } | null>(null);
2102
- const requestWindow = useCallback((req: RowWindowRequest) => {
2103
  if (ids === undefined) return;
2104
  const seq = ++sequence.current;
2105
  lastRequest.current = req;
 
 
 
 
 
 
 
 
 
 
 
2106
  setPage((prev) => ({ key, payload: prev?.key === key ? prev.payload : null, pending: true }));
2107
  void fetchTableWindow(scope, { ...req, ids, related }).then((payload) => {
2108
  if (seq !== sequence.current || currentKey.current !== key) return;
2109
  setPage({ key, payload, pending: false });
2110
  });
2111
- }, [scope, ids, related, key]);
2112
  useEffect(() => {
2113
- const refresh = () => { if (lastRequest.current) requestWindow(lastRequest.current); };
2114
  // React can replay effect setup after cancelling its first request in StrictMode.
2115
- refresh();
2116
  window.addEventListener(ROWS_STALE_EVENT, refresh);
2117
  return () => {
2118
  window.removeEventListener(ROWS_STALE_EVENT, refresh);
@@ -2120,8 +2145,8 @@ function useRecordIdWindow(scope: SurfaceScope, ids: readonly number[] | undefin
2120
  };
2121
  }, [requestWindow]);
2122
  return {
2123
- payload: page?.key === key ? page.payload : null,
2124
- pending: page?.key === key ? page.pending : ids !== undefined,
2125
  requestWindow,
2126
  };
2127
  }
@@ -2143,6 +2168,7 @@ function CustomerGridSurface({
2143
  personalLayoutKey,
2144
  embeddedPayload,
2145
  embeddedRecordIds,
 
2146
  onEmbeddedTotalChange,
2147
  embeddedSelectable = false,
2148
  embeddedSelectedIds = [],
@@ -2189,7 +2215,7 @@ function CustomerGridSurface({
2189
  const embeddedIdsKey = recordIdsKey(embeddedPayload === undefined ? embeddedRecordIds : undefined);
2190
  const embeddedIds = useMemo<readonly number[] | undefined>(
2191
  () => embeddedIdsKey ? JSON.parse(embeddedIdsKey) as number[] : undefined, [embeddedIdsKey]);
2192
- const idWindow = useRecordIdWindow(scope, embeddedIds, relatedPin);
2193
  /**
2194
  * ⭐⭐ W35-T23 (owner item 4 / R2) — **`previewReadOnly` IS GONE, AND THE SPLIT IS THE TICKET.**
2195
  *
 
1738
  visible: string[];
1739
  }
1740
 
1741
+ /** S68-T23: the drill's first page, served by the ID window instead of a second fetch. */
1742
+ type RecordIdInitialPage = {
1743
+ offset: number;
1744
+ limit: number;
1745
+ token?: string | null;
1746
+ filter?: FilterTree;
1747
+ payload: CustomersPayload;
1748
+ };
1749
+
1750
  interface CustomerGridProps {
1751
  scope?: SurfaceScope;
1752
  /** Shell-owned Data workspace location; grid resolves its view/field, never the global rail. */
 
1772
  embeddedPayload?: CustomersPayload | null;
1773
  /** Exact linked pids to page on the server. */
1774
  embeddedRecordIds?: readonly number[];
1775
+ embeddedInitialPage?: RecordIdInitialPage;
1776
  onEmbeddedTotalChange?: (total: number | null) => void;
1777
  /** Selection mode used by an editable ordinary-Link modal. */
1778
  embeddedSelectable?: boolean;
 
1868
  label: string;
1869
  table: SurfaceScope;
1870
  recordIds: readonly number[];
1871
+ initialPage?: RecordIdInitialPage;
1872
  editable?: boolean;
1873
  single?: boolean;
1874
  excludeRecordId?: number;
 
1897
  // chrome slots and a `cellView` modifier while leaving existing callers and the focus trap intact.
1898
  export function LinkGridModal({ label, table, recordIds, editable = false, single = false,
1899
  excludeRecordId, cellView = false, cellFilter, cellFields, onCellFilterChange, onCellDisplayChange,
1900
+ headerActions, footer, initialPage,
1901
  onOpenRecord, onSave, onClose }: LinkGridModalProps) {
1902
  const panelRef = useRef<HTMLDivElement>(null);
1903
  const [selectedIds, setSelectedIds] = useState<number[]>(() => [...recordIds]);
 
1965
  onCellFilterChange={onCellFilterChange}
1966
  onCellDisplayChange={onCellDisplayChange}
1967
  embeddedRecordIds={editable ? undefined : recordIds}
1968
+ embeddedInitialPage={editable ? undefined : initialPage}
1969
  onEmbeddedTotalChange={editable ? undefined : reportTotal}
1970
  embeddedExcludeRecordId={editable ? excludeRecordId : undefined}
1971
  embeddedSelectable={editable}
 
2098
 
2099
  /** An ID-backed grid supplies pages through the existing caller-owned payload seam. */
2100
  function useRecordIdWindow(scope: SurfaceScope, ids: readonly number[] | undefined,
2101
+ related: RelatedPin | null, initialPage?: RecordIdInitialPage) {
2102
+ const key = JSON.stringify([scope, ids, related, initialPage]);
2103
+ const seed = ids !== undefined && !related && initialPage && initialPage.offset === 0
2104
+ ? initialPage.payload : null;
2105
  const currentKey = useRef(key);
2106
  const sequence = useRef(0);
2107
  const lastRequest = useRef<RowWindowRequest | null>(null);
 
2113
  const [page, setPage] = useState<{
2114
  key: string; payload: CustomersPayload | null; pending: boolean;
2115
  } | null>(null);
2116
+ const requestWindow = useCallback((req: RowWindowRequest, fresh = false) => {
2117
  if (ids === undefined) return;
2118
  const seq = ++sequence.current;
2119
  lastRequest.current = req;
2120
+ if (!fresh && seed && initialPage && req.offset === 0
2121
+ && req.limit <= initialPage.limit
2122
+ && JSON.stringify(req.filters ?? []) === JSON.stringify(initialPage.filter?.nodes ?? [])
2123
+ && (req.filterConj ?? "and") === (initialPage.filter?.conj ?? "and")
2124
+ && !req.sorts?.length && !req.search?.trim() && !req.group && !req.related) {
2125
+ const rows = seed.rows.slice(0, req.limit);
2126
+ setPage({ key, payload: { ...seed, rows,
2127
+ counts: seed.counts ? { ...seed.counts, shown: rows.length } : undefined },
2128
+ pending: false });
2129
+ return;
2130
+ }
2131
  setPage((prev) => ({ key, payload: prev?.key === key ? prev.payload : null, pending: true }));
2132
  void fetchTableWindow(scope, { ...req, ids, related }).then((payload) => {
2133
  if (seq !== sequence.current || currentKey.current !== key) return;
2134
  setPage({ key, payload, pending: false });
2135
  });
2136
+ }, [scope, ids, related, key, seed, initialPage]);
2137
  useEffect(() => {
2138
+ const refresh = () => { if (lastRequest.current) requestWindow(lastRequest.current, true); };
2139
  // React can replay effect setup after cancelling its first request in StrictMode.
2140
+ if (lastRequest.current) requestWindow(lastRequest.current);
2141
  window.addEventListener(ROWS_STALE_EVENT, refresh);
2142
  return () => {
2143
  window.removeEventListener(ROWS_STALE_EVENT, refresh);
 
2145
  };
2146
  }, [requestWindow]);
2147
  return {
2148
+ payload: page?.key === key ? page.payload : seed,
2149
+ pending: page?.key === key ? page.pending : !seed && ids !== undefined,
2150
  requestWindow,
2151
  };
2152
  }
 
2168
  personalLayoutKey,
2169
  embeddedPayload,
2170
  embeddedRecordIds,
2171
+ embeddedInitialPage,
2172
  onEmbeddedTotalChange,
2173
  embeddedSelectable = false,
2174
  embeddedSelectedIds = [],
 
2215
  const embeddedIdsKey = recordIdsKey(embeddedPayload === undefined ? embeddedRecordIds : undefined);
2216
  const embeddedIds = useMemo<readonly number[] | undefined>(
2217
  () => embeddedIdsKey ? JSON.parse(embeddedIdsKey) as number[] : undefined, [embeddedIdsKey]);
2218
+ const idWindow = useRecordIdWindow(scope, embeddedIds, relatedPin, embeddedInitialPage);
2219
  /**
2220
  * ⭐⭐ W35-T23 (owner item 4 / R2) — **`previewReadOnly` IS GONE, AND THE SPLIT IS THE TICKET.**
2221
  *
web/src/manage-agent/ManageAgentPane.tsx CHANGED
@@ -289,8 +289,8 @@ export function ManageAgentPane() {
289
  </button>
290
  <h3 className="set-h">{edit.agent.label || edit.agent.channelName || edit.agent.channel}</h3>
291
  <p className="set-help ma-principal">
292
- This wall applies to the CHANNEL, not to the people in it. Everyone who can
293
- talk to this bot reads through the same rules.
294
  </p>
295
 
296
  {edit.phase === "loading" ? (
@@ -412,8 +412,8 @@ export function ManageAgentPane() {
412
  principal.
413
  </p>
414
  <p className="set-help">
415
- Replies start only after an explicit @mention. An automated reply is limited to a
416
- workflow explicitly authorized for this channel.
417
  </p>
418
 
419
  {load.phase === "loading" ? (
 
289
  </button>
290
  <h3 className="set-h">{edit.agent.label || edit.agent.channelName || edit.agent.channel}</h3>
291
  <p className="set-help ma-principal">
292
+ These rules apply to automated workflow replies in this channel. An @mention is
293
+ answered with the access every linked member of the channel shares.
294
  </p>
295
 
296
  {edit.phase === "loading" ? (
 
412
  principal.
413
  </p>
414
  <p className="set-help">
415
+ An automated reply is limited to a workflow explicitly authorized for this channel.
416
+ An explicit @mention is answered with the access every linked member of the channel shares.
417
  </p>
418
 
419
  {load.phase === "loading" ? (
web/src/settings/ExternalAccessPane.tsx CHANGED
@@ -13,6 +13,7 @@ import { API_V1, CREDENTIALS, UNAUTHORIZED_EVENT, checkTenant } from "../apiCont
13
  import { Mark } from "../shell/Brand";
14
  import { AiClientMark } from "./aiClientMarks";
15
  import SlackSection from "./channels/SlackSection";
 
16
 
17
  type Access = "read" | "readwrite";
18
  type ResourceScope = string[] | "all";
@@ -1143,6 +1144,8 @@ export default function ExternalAccessPane() {
1143
 
1144
  <SlackSection />
1145
 
 
 
1146
  <div className="set-perm-sect"><h2 className="set-h4">API keys</h2></div>
1147
  {keysError ? <><p className="set-help" role="alert">{keysError}</p>
1148
  <div className="set-actions"><button type="button" className="set-secondary" disabled={busy !== ""}
 
13
  import { Mark } from "../shell/Brand";
14
  import { AiClientMark } from "./aiClientMarks";
15
  import SlackSection from "./channels/SlackSection";
16
+ import WhatsAppSection from "./channels/WhatsAppSection";
17
 
18
  type Access = "read" | "readwrite";
19
  type ResourceScope = string[] | "all";
 
1144
 
1145
  <SlackSection />
1146
 
1147
+ <WhatsAppSection />
1148
+
1149
  <div className="set-perm-sect"><h2 className="set-h4">API keys</h2></div>
1150
  {keysError ? <><p className="set-help" role="alert">{keysError}</p>
1151
  <div className="set-actions"><button type="button" className="set-secondary" disabled={busy !== ""}
web/src/shell/Shell.tsx CHANGED
@@ -95,7 +95,7 @@ import type { DeletedItem } from "../starred/starredApi";
95
  import { Brand } from "./Brand";
96
  import { ErrorBoundary } from "./ErrorBoundary";
97
  import LoginPage from "./LoginPage";
98
- import { APP_ROUTE, ASSISTANT_ROUTE, CONNECTORS_ROUTE, DATA_ROUTE, EMPTY_NAV_PREFS, ENVELOPE_KEYS, FEEDBACK_ROUTE, HOME_ROUTE, INBOX_ROUTE, NO_SUBSCRIPTION_TENANT, SUBSCRIPTION_ROUTE, USAGE_ROUTE, NAV_ATTEMPTS, NAV_MALFORMED_STATUS, NAV_RETRY_DELAYS_MS, NAV_STAYS_EXPANDED_ROUTES, NAV_TIMEOUT_STATUS, agentAddressHash, appLink, canonicalRoute, databaseEntries, defaultRoute, deleteTable, fetchNav, fetchNavPrefs, fetchSchema, fetchTableFootprint, postOpened, QUERY_ROUTE, dataAddressHash, readAgentAddress, readDataAddress, reportNavTimeout, resolveRoute, rewrittenHash, routeKeyOf, saveNavMeta, shapeNav, splitChrome } from "./nav";
99
  import type { NavEntry, NavMetaPatch, NavPage, NavPrefs, RailSlot, Recent, SchemaField, SchemaPayload } from "./nav";
100
  // ⭐ 2026-08-14 — the database frame, extracted so the Query module can wear the SAME one.
101
  // ⛔ W53-T35 — `DbIcon` IS NO LONGER IMPORTED HERE. The Data row wears `icons.tsx::DatabaseIcon`
@@ -269,8 +269,9 @@ function useDataFolderIndex(owner: string | null, notify: (message: string) => v
269
  * no longer imported here — C's `W32-T21` deletes the file, and an unmounted-but-imported
270
  * component is [[artifact-with-no-importer]] wearing the other mask. */
271
  const InboxPage = lazy(() => import("../inbox/InboxPage"));
272
- /** ⭐⭐ W32-T05 (R1, C5, wiring 2): the Query module — E's page, A's mount. */
273
- const QueryPage = lazy(() => import("../query/QueryPage"));
 
274
  /**
275
  * ⭐⭐ 2026-08-14 (owner item 2) — THE AI ASSISTANT, UNBOARDED.
276
  *
@@ -333,6 +334,7 @@ function boardedFor(
333
  ): string {
334
  const BOARDED: ReadonlyArray<[string, string, string]> = [
335
  [ASSISTANT_ROUTE, "analyst", "Assistant"],
 
336
  ["automation", "automation", "Agents"],
337
  ];
338
  for (const [r, key, label] of BOARDED) {
@@ -1213,6 +1215,15 @@ function StranglerPage({ entry }: { entry: NavEntry }) {
1213
  that vocabulary lives now. */
1214
 
1215
 
 
 
 
 
 
 
 
 
 
1216
  /** The retained `is-spark` hook suppresses the parent stroke, so this dotted ring reuses the
1217
  * row's `currentColor` directly while the shared glyph rule still owns width and round caps. */
1218
  function SparkIcon() {
@@ -3228,6 +3239,9 @@ function ShellFrame() {
3228
  : "absent";
3229
  const automationSlot: RailSlot = railSlot(!!automation);
3230
  const analystSlot: RailSlot = railSlot(!!analyst);
 
 
 
3231
  const financeAppKey = /^#\/finance\/([^/?#]+)/.exec(hash)?.[1];
3232
  const financeCurrent = Boolean(financeAppKey);
3233
  // WAVE 23 C10 — the flyout's search. A plain label substring, case-folded: this list is at
@@ -3504,6 +3518,40 @@ function ShellFrame() {
3504
  style={{ display: "none" }}
3505
  />
3506
  )}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3507
 
3508
  {/* WAVE 55 instruction 2: the first group is complete even when Assistant is absent.
3509
  Home and Inbox remain real rows, so this boundary is stable rather than permission
@@ -4177,16 +4225,10 @@ function ShellFrame() {
4177
  </p>
4178
  </div>
4179
  </Lazily>
4180
- ) : route === QUERY_ROUTE ? (
4181
- // ⭐⭐ W32-T05 (R1, C5, wirings 2 and 6) — THE QUERY MODULE, where AI-built views live.
4182
- //
4183
- // ⛔ `granted` IS REQUIRED, AND IT IS ALSO WHAT MAKES THIS A LEGAL CHROME ROUTE. It is
4184
- // the nav entries this shell ALREADY holds from `/nav` — the set the SERVER decided this
4185
- // session may see — so the page makes no listing call of its own and *"a chrome route
4186
- // renders nothing the server did not already grant"* is true by construction. The AI
4187
- // therefore cannot name a database the caller was not already given: C5's permission
4188
- // clause is the existing wall re-used, never a second one built beside it.
4189
- <Lazily surface="Query"><QueryPage granted={entries} /></Lazily>
4190
  ) : route === ASSISTANT_ROUTE ? (
4191
  // ⭐⭐ 2026-08-14 (owner item 2) — THE AI ASSISTANT, where the question is asked.
4192
  //
 
95
  import { Brand } from "./Brand";
96
  import { ErrorBoundary } from "./ErrorBoundary";
97
  import LoginPage from "./LoginPage";
98
+ import { APP_ROUTE, ARTIFACTS_ROUTE, ASSISTANT_ROUTE, CONNECTORS_ROUTE, DATA_ROUTE, EMPTY_NAV_PREFS, ENVELOPE_KEYS, FEEDBACK_ROUTE, HOME_ROUTE, INBOX_ROUTE, NO_SUBSCRIPTION_TENANT, SUBSCRIPTION_ROUTE, USAGE_ROUTE, NAV_ATTEMPTS, NAV_MALFORMED_STATUS, NAV_RETRY_DELAYS_MS, NAV_STAYS_EXPANDED_ROUTES, NAV_TIMEOUT_STATUS, agentAddressHash, appLink, canonicalRoute, databaseEntries, defaultRoute, deleteTable, fetchNav, fetchNavPrefs, fetchSchema, fetchTableFootprint, postOpened, dataAddressHash, readAgentAddress, readDataAddress, reportNavTimeout, resolveRoute, rewrittenHash, routeKeyOf, saveNavMeta, shapeNav, splitChrome } from "./nav";
99
  import type { NavEntry, NavMetaPatch, NavPage, NavPrefs, RailSlot, Recent, SchemaField, SchemaPayload } from "./nav";
100
  // ⭐ 2026-08-14 — the database frame, extracted so the Query module can wear the SAME one.
101
  // ⛔ W53-T35 — `DbIcon` IS NO LONGER IMPORTED HERE. The Data row wears `icons.tsx::DatabaseIcon`
 
269
  * no longer imported here — C's `W32-T21` deletes the file, and an unmounted-but-imported
270
  * component is [[artifact-with-no-importer]] wearing the other mask. */
271
  const InboxPage = lazy(() => import("../inbox/InboxPage"));
272
+ /** S68-T54 (R37, C14): Artifacts, where everything the agent made lives; it hosts the Query page
273
+ * for a saved Query answer, and `#/query` lands here (`nav.ts::REWRITTEN_ROUTES`). */
274
+ const ArtifactsPage = lazy(() => import("../artifacts/ArtifactsPage"));
275
  /**
276
  * ⭐⭐ 2026-08-14 (owner item 2) — THE AI ASSISTANT, UNBOARDED.
277
  *
 
334
  ): string {
335
  const BOARDED: ReadonlyArray<[string, string, string]> = [
336
  [ASSISTANT_ROUTE, "analyst", "Assistant"],
337
+ [ARTIFACTS_ROUTE, "analyst", "Artifacts"],
338
  ["automation", "automation", "Agents"],
339
  ];
340
  for (const [r, key, label] of BOARDED) {
 
1215
  that vocabulary lives now. */
1216
 
1217
 
1218
+ /** S68-T54 (R37): the Artifacts row's glyph, stacked sheets, drawn on the shell's 16px stroke grid. */
1219
+ function ArtifactsIcon() {
1220
+ return (
1221
+ <svg className="shell-nav-icon" viewBox="0 0 16 16" aria-hidden="true">
1222
+ <path d="M5 2.5h6.5v9H5zM2.5 5v8.5H9M7 5.5h2.5M7 8h2.5" />
1223
+ </svg>
1224
+ );
1225
+ }
1226
+
1227
  /** The retained `is-spark` hook suppresses the parent stroke, so this dotted ring reuses the
1228
  * row's `currentColor` directly while the shared glyph rule still owns width and round caps. */
1229
  function SparkIcon() {
 
3239
  : "absent";
3240
  const automationSlot: RailSlot = railSlot(!!automation);
3241
  const analystSlot: RailSlot = railSlot(!!analyst);
3242
+ // S68-T54 (R37): Artifacts rides the SAME `analyst` grant, but it is its own rail row, so it
3243
+ // gets its own slot from the one rule (verify_wiring: one `railSlot(` per conditional row).
3244
+ const artifactsSlot: RailSlot = railSlot(!!analyst);
3245
  const financeAppKey = /^#\/finance\/([^/?#]+)/.exec(hash)?.[1];
3246
  const financeCurrent = Boolean(financeAppKey);
3247
  // WAVE 23 C10 — the flyout's search. A plain label substring, case-folded: this list is at
 
3518
  style={{ display: "none" }}
3519
  />
3520
  )}
3521
+ {/* S68-T54 (R37): Artifacts sits DIRECTLY under Assistant and is served by the SAME
3522
+ `analyst` grant (no registry key, so no grant migration), with the same three arms
3523
+ for the same reason the Assistant row has them (W33-T22's layout-jump report). */}
3524
+ {analyst ? (
3525
+ <button
3526
+ type="button"
3527
+ className={"shell-nav-item shell-nav-artifacts" + (route === ARTIFACTS_ROUTE ? " is-active" : "")}
3528
+ onClick={() => {
3529
+ expandOnNavClick();
3530
+ window.location.hash = `#/${ARTIFACTS_ROUTE}`;
3531
+ }}
3532
+ onMouseEnter={navCollapsed ? tipEnter("Artifacts") : undefined}
3533
+ onMouseLeave={navCollapsed ? tipLeave : undefined}
3534
+ >
3535
+ <ArtifactsIcon />
3536
+ <span className="shell-nav-label">Artifacts</span>
3537
+ </button>
3538
+ ) : artifactsSlot === "unavailable" ? (
3539
+ <div
3540
+ className="shell-nav-item shell-nav-artifacts is-unavailable"
3541
+ title={nav.phase === "error" ? navFailureMessage : "This list could not be loaded in full. Reload to retry."}
3542
+ >
3543
+ <ArtifactsIcon />
3544
+ <span className="shell-nav-label shell-nav-label--muted">Artifacts</span>
3545
+ <span className="shell-nav-note-dot" aria-hidden="true" />
3546
+ </div>
3547
+ ) : (
3548
+ <div
3549
+ className="shell-nav-item shell-nav-artifacts is-rail-skeleton"
3550
+ aria-hidden="true"
3551
+ hidden
3552
+ style={{ display: "none" }}
3553
+ />
3554
+ )}
3555
 
3556
  {/* WAVE 55 instruction 2: the first group is complete even when Assistant is absent.
3557
  Home and Inbox remain real rows, so this boundary is stable rather than permission
 
4225
  </p>
4226
  </div>
4227
  </Lazily>
4228
+ ) : route === ARTIFACTS_ROUTE ? (
4229
+ // S68-T54 (R37, C14): Artifacts takes over Query. `granted` is the nav entries this shell
4230
+ // already holds from `/nav`, so the page names no database the server did not grant.
4231
+ <Lazily surface="Artifacts"><ArtifactsPage granted={entries} /></Lazily>
 
 
 
 
 
 
4232
  ) : route === ASSISTANT_ROUTE ? (
4233
  // ⭐⭐ 2026-08-14 (owner item 2) — THE AI ASSISTANT, where the question is asked.
4234
  //
web/src/shell/nav.ts CHANGED
@@ -1366,6 +1366,7 @@ export const QUERY_ROUTE = "query";
1366
  * layout-jump report, which is what that ticket was.
1367
  */
1368
  export const ASSISTANT_ROUTE = "assistant";
 
1369
 
1370
  /**
1371
  * ⭐⭐ WAVE 35 · T06 (owner item 13, contract C6) — the three ACCOUNT routes. Owner: *"add below
@@ -1411,6 +1412,7 @@ export const CHROME_ROUTES: ReadonlySet<string> = new Set([
1411
  INBOX_ROUTE,
1412
  QUERY_ROUTE,
1413
  ASSISTANT_ROUTE,
 
1414
  FEEDBACK_ROUTE,
1415
  USAGE_ROUTE,
1416
  SUBSCRIPTION_ROUTE,
@@ -1475,32 +1477,13 @@ export const LEGACY_ROUTES: Readonly<Record<string, string>> = {
1475
  * Home — a worse answer to the same question.
1476
  */
1477
  "ai-agent": ASSISTANT_ROUTE,
1478
- /**
1479
- * ⭐⭐ WAVE 34 (ruling R14, contract C2) — QUERY IS MERGED INTO THE ASSISTANT.
1480
- *
1481
- * Owner: *"Combine the AI assistant module AND the Query module. In the secondary navigation at
1482
- * the top, just above '+ New chat', an easily accessible toggle between Chat / Query."* So there
1483
- * is ONE route and one rail row, and `#/query` is a hash people hold: bookmarked, pasted, and
1484
- * left in an open tab since wave 32.
1485
- *
1486
- * ⚠ THIS ENTRY IS THE INSTANT-RESOLVE HALF ONLY. It stops the frame rendering Home for the one
1487
- * paint before the URL is rewritten; `REWRITTEN_ROUTES` below is what actually puts
1488
- * `?mode=query` on the address bar, and the Query LIST only opens because of that.
1489
- */
1490
- [QUERY_ROUTE]: ASSISTANT_ROUTE,
1491
  };
1492
 
1493
- /**
1494
- * ⭐⭐ WAVE 34 R14 / C2 — retired hashes the shell REWRITES rather than merely resolves.
1495
- *
1496
- * ⛔ WHY THIS IS NOT JUST ANOTHER `LEGACY_ROUTES` ROW. A legacy row is an internal translation:
1497
- * the address bar keeps saying `#/ai-agent` and nothing downstream cares. Query cannot work that
1498
- * way, because the merged surface decides WHICH LIST to show from `?mode=` on the hash — so a
1499
- * resolve that never touched the URL would land the reader on the Chat list, which is the opposite
1500
- * of what their bookmark asked for.
1501
- */
1502
  export const REWRITTEN_ROUTES: Readonly<Record<string, string>> = {
1503
- [QUERY_ROUTE]: `${ASSISTANT_ROUTE}?mode=query`,
1504
  [STARRED_ROUTE]: `${HOME_ROUTE}?filter=starred`,
1505
  };
1506
 
 
1366
  * layout-jump report, which is what that ticket was.
1367
  */
1368
  export const ASSISTANT_ROUTE = "assistant";
1369
+ export const ARTIFACTS_ROUTE = "artifacts";
1370
 
1371
  /**
1372
  * ⭐⭐ WAVE 35 · T06 (owner item 13, contract C6) — the three ACCOUNT routes. Owner: *"add below
 
1412
  INBOX_ROUTE,
1413
  QUERY_ROUTE,
1414
  ASSISTANT_ROUTE,
1415
+ ARTIFACTS_ROUTE,
1416
  FEEDBACK_ROUTE,
1417
  USAGE_ROUTE,
1418
  SUBSCRIPTION_ROUTE,
 
1477
  * Home — a worse answer to the same question.
1478
  */
1479
  "ai-agent": ASSISTANT_ROUTE,
1480
+ // R37: saved Query answers live in Artifacts, served by the same analyst grant.
1481
+ [QUERY_ROUTE]: ARTIFACTS_ROUTE,
 
 
 
 
 
 
 
 
 
 
 
1482
  };
1483
 
1484
+ /** Rewrite retired hashes before the shell publishes their destination. */
 
 
 
 
 
 
 
 
1485
  export const REWRITTEN_ROUTES: Readonly<Record<string, string>> = {
1486
+ [QUERY_ROUTE]: ARTIFACTS_ROUTE,
1487
  [STARRED_ROUTE]: `${HOME_ROUTE}?filter=starred`,
1488
  };
1489
 
web/wiring_rows/s68_combine.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Mount contracts named by the SDLC 68 merged-tree coverage ratchet.
2
+
3
+ Four mounted components had no WIRINGS row here: three arrived with master hotfixes before the wave
4
+ base (GridPager, CellContextMenu, FormatCellsDialog) and one with the wave (PasteSpecialDialog).
5
+ PingCard (S68-T53) rides in CA1. Each row follows the data or the action into its real consumer rather than
6
+ matching a bare `<Component`, so a mount rewired to the wrong prop or state goes red. Rows, not
7
+ COVERAGE_BASELINE entries: the baseline is the list of components nobody has wired yet.
8
+ """
9
+
10
+ ROWS = [
11
+ # (PingCard's row rides in CA1, S68-T54's patch, in verify_wiring.py's WIRINGS.)
12
+ # HOTFIX 2026-09-23: the pager reads the server's own matched count, and its page control
13
+ # moves the grid's window. Both halves, or a pager can render over the wrong population.
14
+ ("S68 combine the grid pager pages the server's matched population",
15
+ "customer-grid/GridPager.tsx", r"export function GridPager\(",
16
+ "customer-grid/CustomerGrid.tsx",
17
+ r"<GridPager\b(?:(?!/>)[\s\S])*?total=\{serverWindowed \? \(payload\?\.counts\?\.matched \?\? 0\)"
18
+ r" : filteredPids\.length\}(?:(?!/>)[\s\S])*?onPage=\{goToPage\}"),
19
+ # S67-T07 / S67-T08: one component serves the cell menu and the row and column header menus.
20
+ ("S68 combine a right clicked cell opens the cell menu, whose actions reach the grid",
21
+ "sheet/CellContextMenu.tsx", r"export default function CellContextMenu\(",
22
+ "sheet/SheetGrid.tsx",
23
+ r'menu\.on === "cell" && \(\s*<CellContextMenu\b(?:(?!/>)[\s\S])*?onAct=\{onCellMenuAct\}'),
24
+ ("S68 combine a right clicked row or column header opens the same menu in its header shape",
25
+ "sheet/CellContextMenu.tsx", r"export default function CellContextMenu\(",
26
+ "sheet/SheetGrid.tsx",
27
+ r'menu\.on !== "cell" && \(\s*<CellContextMenu\b(?:(?!/>)[\s\S])*?'
28
+ r'kind=\{menu\.on === "column" \? "column" : "row"\}'),
29
+ # S67-T16: Format Cells is mounted by the Home tab's host, which applies the patch it returns,
30
+ # and the cell menu's "Format Cells" opens it through the event the host listens for.
31
+ ("S68 combine the Format Cells dialog applies its patch through the Home tab host",
32
+ "sheet/FormatCellsDialog.tsx", r"export function FormatCellsDialog\(",
33
+ "sheet/ribbonHome.tsx",
34
+ r"<FormatCellsDialog\b(?:(?!/>)[\s\S])*?onApply=\{\(patch\) => \{\s*"
35
+ r"setFormatCellsRequest\(null\);\s*apply\(patch\);"),
36
+ ("S68 combine the Format Cells host is mounted inside the Home tab's Font group",
37
+ "sheet/ribbonHome.tsx", r"function FormatCellsHost\(",
38
+ "sheet/ribbonHome.tsx", r"<FormatCellsHost style=\{style\} apply=\{apply\} />"),
39
+ ("S68 combine the cell menu's Format Cells raises the event the Home tab host listens for",
40
+ "sheet/ribbonHome.tsx", r'const FORMAT_CELLS_EVENT = "aios:sheet-format-cells";',
41
+ "sheet/SheetGrid.tsx",
42
+ r'case "format-cells":\s*window\.dispatchEvent\(new CustomEvent\("aios:sheet-format-cells"'),
43
+ # Paste Special: the dialog's choice reaches the paste with the payload it was opened for, and
44
+ # the cell menu's "Paste Special" entry opens it.
45
+ ("S68 combine Paste Special pastes the held payload with the chosen options",
46
+ "sheet/PasteSpecialDialog.tsx", r"export function PasteSpecialDialog\(",
47
+ "sheet/SheetGrid.tsx",
48
+ r"\{pasteSpecial && !readOnly && <PasteSpecialDialog\b(?:(?!/>)[\s\S])*?"
49
+ r"pasteFromClipboard\(options, pasteSpecial\.payload\)"),
50
+ ("S68 combine the cell menu's Paste Special entry opens the dialog",
51
+ "sheet/CellContextMenu.tsx", r'onClick=\{\(\) => act\("paste-special"\)\}',
52
+ "sheet/SheetGrid.tsx", r'case "paste-special": openPasteSpecial\(\); return;'),
53
+ ]