Deploy AIOS web (React glide grid + FastAPI slice)
Browse files- RELEASES.json +1 -1
- VERSION +1 -1
- api/routes_activity.py +3 -0
- api/routes_alerts.py +9 -7
- api/routes_nav.py +3 -0
- platform/core/route_system.py +7 -1
- web/public/AIOS_DEPLOY_RECEIPT +1 -1
- web/src/shell/Shell.tsx +6 -1
RELEASES.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"current": "
|
| 3 |
"releases": []
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"current": "b1ac90e2",
|
| 3 |
"releases": []
|
| 4 |
}
|
VERSION
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
b1ac90e2
|
api/routes_activity.py
CHANGED
|
@@ -331,6 +331,9 @@ async def ingest_activity(request: Request, session: Session = Depends(require_s
|
|
| 331 |
clean.append({**event, "eventId": uuid.uuid4().hex})
|
| 332 |
dropped = len(events) - len(clean)
|
| 333 |
clean.sort(key=lambda event: event["ts"])
|
|
|
|
|
|
|
|
|
|
| 334 |
if clean:
|
| 335 |
try:
|
| 336 |
await run_in_threadpool(_record, session, session_id, clean,
|
|
|
|
| 331 |
clean.append({**event, "eventId": uuid.uuid4().hex})
|
| 332 |
dropped = len(events) - len(clean)
|
| 333 |
clean.sort(key=lambda event: event["ts"])
|
| 334 |
+
from core import freeze_notice
|
| 335 |
+
if freeze_notice.enabled():
|
| 336 |
+
return {"accepted": 0, "dropped": len(events)}
|
| 337 |
if clean:
|
| 338 |
try:
|
| 339 |
await run_in_threadpool(_record, session, session_id, clean,
|
api/routes_alerts.py
CHANGED
|
@@ -646,7 +646,7 @@ def run_alert(alert_id: str, session: Session = Depends(require_session)):
|
|
| 646 |
|
| 647 |
@router.get("/notifications")
|
| 648 |
def notifications(session: Session = Depends(require_session)):
|
| 649 |
-
"""The inbox
|
| 650 |
|
| 651 |
⭐ A-S1-2 RESOLVED THE OTHER WAY, and the reason is structural rather than a shortcut. The
|
| 652 |
plan was a push hook: the automation engine calls `after_write` when it lands rows. But
|
|
@@ -673,12 +673,14 @@ def notifications(session: Session = Depends(require_session)):
|
|
| 673 |
feature. ⚠ Making the read cheap by evaluating LESS is the obvious wrong fix and is not what
|
| 674 |
this does: every alert is still evaluated, against the same rows, in the same order.
|
| 675 |
"""
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
|
|
|
|
|
|
| 682 |
# ⭐ W32-T20 (C3): every item leaves through `inbox_view`, so a notification queued before
|
| 683 |
# this wave carries a `target` too. See `notification_view`'s header for why it is derived.
|
| 684 |
box = inbox_view(alerts.inbox(session.uname, st=session.runtime))
|
|
|
|
| 646 |
|
| 647 |
@router.get("/notifications")
|
| 648 |
def notifications(session: Session = Depends(require_session)):
|
| 649 |
+
"""The inbox re-evaluates on read unless maintenance freezes writes.
|
| 650 |
|
| 651 |
⭐ A-S1-2 RESOLVED THE OTHER WAY, and the reason is structural rather than a shortcut. The
|
| 652 |
plan was a push hook: the automation engine calls `after_write` when it lands rows. But
|
|
|
|
| 673 |
feature. ⚠ Making the read cheap by evaluating LESS is the obvious wrong fix and is not what
|
| 674 |
this does: every alert is still evaluated, against the same rows, in the same order.
|
| 675 |
"""
|
| 676 |
+
from core import freeze_notice
|
| 677 |
+
if not freeze_notice.enabled():
|
| 678 |
+
assemblies = {}
|
| 679 |
+
for rec in alerts.list_alerts(user=session.uname, is_admin=False, st=session.runtime):
|
| 680 |
+
try:
|
| 681 |
+
_evaluate(session, rec, assemblies=assemblies)
|
| 682 |
+
except Exception: # noqa: BLE001
|
| 683 |
+
continue # one bad alert must not empty the pane
|
| 684 |
# ⭐ W32-T20 (C3): every item leaves through `inbox_view`, so a notification queued before
|
| 685 |
# this wave carries a `target` too. See `notification_view`'s header for why it is derived.
|
| 686 |
box = inbox_view(alerts.inbox(session.uname, st=session.runtime))
|
api/routes_nav.py
CHANGED
|
@@ -895,6 +895,9 @@ def nav_opened(body: dict = Body(default=None),
|
|
| 895 |
key = str(body.get("key") or "").strip()[:60]
|
| 896 |
if not key:
|
| 897 |
raise err(400, "bad_request", "no page was named")
|
|
|
|
|
|
|
|
|
|
| 898 |
if not session.runtime.available():
|
| 899 |
raise err(503, "store_unavailable",
|
| 900 |
"the tenant store is unavailable. Nothing was recorded.")
|
|
|
|
| 895 |
key = str(body.get("key") or "").strip()[:60]
|
| 896 |
if not key:
|
| 897 |
raise err(400, "bad_request", "no page was named")
|
| 898 |
+
from core import freeze_notice
|
| 899 |
+
if freeze_notice.enabled():
|
| 900 |
+
return {"key": key, "at": _now()}
|
| 901 |
if not session.runtime.available():
|
| 902 |
raise err(503, "store_unavailable",
|
| 903 |
"the tenant store is unavailable. Nothing was recorded.")
|
platform/core/route_system.py
CHANGED
|
@@ -591,7 +591,13 @@ def reconcile_inbox_tasks(st, *, today=None):
|
|
| 591 |
|
| 592 |
|
| 593 |
def inbox_tasks(st, assignee, *, today=None):
|
| 594 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 595 |
if str(task.get("assignee") or "").lower() == str(assignee or "").lower()]
|
| 596 |
|
| 597 |
|
|
|
|
| 591 |
|
| 592 |
|
| 593 |
def inbox_tasks(st, assignee, *, today=None):
|
| 594 |
+
from core import freeze_notice
|
| 595 |
+
if freeze_notice.enabled():
|
| 596 |
+
# Reconcile only the detached read; durable receipts remain unchanged.
|
| 597 |
+
tasks = _reconcile_inbox_state(copy.deepcopy(read(st)), _inbox_day(today, st=st))
|
| 598 |
+
else:
|
| 599 |
+
tasks = reconcile_inbox_tasks(st, today=today)
|
| 600 |
+
return [task for task in tasks
|
| 601 |
if str(task.get("assignee") or "").lower() == str(assignee or "").lower()]
|
| 602 |
|
| 603 |
|
web/public/AIOS_DEPLOY_RECEIPT
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
d768f2d0f1b3771886ec5ce8d5231aa27f11823927a482da23265e26d0214b10
|
web/src/shell/Shell.tsx
CHANGED
|
@@ -2225,6 +2225,12 @@ function ShellFrame() {
|
|
| 2225 |
// every state write would re-fetch the nav for no reason.
|
| 2226 |
const who = session.phase === "authed" ? session.user.username : null;
|
| 2227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2228 |
const leaveDeletedApplication = useCallback((database: string, application: string) => {
|
| 2229 |
const live = readDataPath(window.location.hash);
|
| 2230 |
if (live?.database !== database || live.application !== application) return;
|
|
@@ -2326,7 +2332,6 @@ function ShellFrame() {
|
|
| 2326 |
// a sign-out/sign-in and the freshly authenticated user lands on an error
|
| 2327 |
// panel describing something that happened to somebody else's session.
|
| 2328 |
setDataError("");
|
| 2329 |
-
setToast("");
|
| 2330 |
void (async () => {
|
| 2331 |
for (let attempt = 1; attempt <= NAV_ATTEMPTS; attempt++) {
|
| 2332 |
if (attempt > 1) {
|
|
|
|
| 2225 |
// every state write would re-fetch the nav for no reason.
|
| 2226 |
const who = session.phase === "authed" ? session.user.username : null;
|
| 2227 |
|
| 2228 |
+
// Clear the toast on sign-out, session loss or account change. A navigation refresh
|
| 2229 |
+
// keeps the current session's toast until its normal expiry.
|
| 2230 |
+
useEffect(() => {
|
| 2231 |
+
setToast("");
|
| 2232 |
+
}, [who]);
|
| 2233 |
+
|
| 2234 |
const leaveDeletedApplication = useCallback((database: string, application: string) => {
|
| 2235 |
const live = readDataPath(window.location.hash);
|
| 2236 |
if (live?.database !== database || live.application !== application) return;
|
|
|
|
| 2332 |
// a sign-out/sign-in and the freshly authenticated user lands on an error
|
| 2333 |
// panel describing something that happened to somebody else's session.
|
| 2334 |
setDataError("");
|
|
|
|
| 2335 |
void (async () => {
|
| 2336 |
for (let attempt = 1; attempt <= NAV_ATTEMPTS; attempt++) {
|
| 2337 |
if (attempt > 1) {
|