fsanyoto commited on
Commit
e2a25cb
·
verified ·
1 Parent(s): ed522b3

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,4 +1,4 @@
1
  {
2
- "current": "6ca559b5c8c",
3
  "releases": []
4
  }
 
1
  {
2
+ "current": "f2a3978b33b",
3
  "releases": []
4
  }
VERSION CHANGED
@@ -1 +1 @@
1
- 6ca559b5c8c
 
1
+ f2a3978b33b
platform/harness/amazon_store.py CHANGED
@@ -1755,12 +1755,16 @@ class _AmazonMirrorStore(_mirrors.MirrorStore):
1755
  and not _mirrors._table_sync_complete("amazon", row)}
1756
  # Head and lines come from one document, so neither publishes without the other.
1757
  pairs = {**SHARED_REPORT_SIBLINGS, **{line: head for head, line in SHARED_REPORT_SIBLINGS.items()}}
1758
- unfinished |= {pairs[name] for name in unfinished if name in pairs}
 
1759
  owners = {key for name in set(rows) | unfinished for key in (name, table_name(name))}
1760
  blocked = [str(problem) for key in ("problems", "audit_problems") for problem in report.get(key) or []
1761
  if str(problem).split(":", 1)[0].strip() not in owners]
1762
  held = {}
1763
  for name in sorted(unfinished):
 
 
 
1764
  row = rows.get(name) if isinstance(rows.get(name), dict) else {}
1765
  state = " ".join(str(part) for part in (row.get("state") or "not reached in this pass",
1766
  row.get("amazonStatus")) if part)
@@ -3019,11 +3023,15 @@ def _validate_orders(con):
3019
  if not marker.get("count"):
3020
  return {"state": "unproven", "reason": "Amazon order metrics returned no intervals"}
3021
  expected = marker["metrics"]["orders"]
 
 
 
 
3022
  actual = con.execute(
3023
  "SELECT COUNT(DISTINCT amazon_order_id) FROM amzn_orders "
3024
  "WHERE CAST(purchase_date AS TIMESTAMPTZ) >= CAST(? AS TIMESTAMPTZ) "
3025
  "AND CAST(purchase_date AS TIMESTAMPTZ) < CAST(? AS TIMESTAMPTZ) "
3026
- "AND lower(COALESCE(order_status, '')) NOT IN ('cancelled', 'canceled')",
3027
  [marker["start"], marker["end"]]).fetchone()[0]
3028
  return {"state": "ok" if expected == actual else "refused",
3029
  "expected": expected, "actual": actual,
@@ -5614,6 +5622,12 @@ def group_a_selftest(log=print, check=None):
5614
  "('O3','2026-07-04T00:00:00Z','Cancelled')")
5615
  ck("orders independently reconcile Sales API counts and exclude cancelled orders",
5616
  red and _validate_orders(con)["state"] == "ok")
 
 
 
 
 
 
5617
  spec = cx.REPORT_TYPES["reimbursements"]
5618
  with patch.object(cx, "report_document", return_value=(
5619
  "sku\tamount\n", {"reportDocumentId": "empty", "createdTime": _iso(end)})):
 
1755
  and not _mirrors._table_sync_complete("amazon", row)}
1756
  # Head and lines come from one document, so neither publishes without the other.
1757
  pairs = {**SHARED_REPORT_SIBLINGS, **{line: head for head, line in SHARED_REPORT_SIBLINGS.items()}}
1758
+ partner = {pairs[name]: name for name in unfinished if name in pairs and pairs[name] not in unfinished}
1759
+ unfinished |= set(partner)
1760
  owners = {key for name in set(rows) | unfinished for key in (name, table_name(name))}
1761
  blocked = [str(problem) for key in ("problems", "audit_problems") for problem in report.get(key) or []
1762
  if str(problem).split(":", 1)[0].strip() not in owners]
1763
  held = {}
1764
  for name in sorted(unfinished):
1765
+ if name in partner:
1766
+ held[name] = f"held with {partner[name]}, which reads the same report document"
1767
+ continue
1768
  row = rows.get(name) if isinstance(rows.get(name), dict) else {}
1769
  state = " ".join(str(part) for part in (row.get("state") or "not reached in this pass",
1770
  row.get("amazonStatus")) if part)
 
3023
  if not marker.get("count"):
3024
  return {"state": "unproven", "reason": "Amazon order metrics returned no intervals"}
3025
  expected = marker["metrics"]["orders"]
3026
+ # getOrderMetrics counts the US marketplace only; the order report also carries CA, MX and MCF orders.
3027
+ columns = {row[0] for row in con.execute(
3028
+ "SELECT column_name FROM information_schema.columns WHERE table_name='amzn_orders'").fetchall()}
3029
+ channel = " AND sales_channel = 'Amazon.com'" if "sales_channel" in columns else ""
3030
  actual = con.execute(
3031
  "SELECT COUNT(DISTINCT amazon_order_id) FROM amzn_orders "
3032
  "WHERE CAST(purchase_date AS TIMESTAMPTZ) >= CAST(? AS TIMESTAMPTZ) "
3033
  "AND CAST(purchase_date AS TIMESTAMPTZ) < CAST(? AS TIMESTAMPTZ) "
3034
+ "AND lower(COALESCE(order_status, '')) NOT IN ('cancelled', 'canceled')" + channel,
3035
  [marker["start"], marker["end"]]).fetchone()[0]
3036
  return {"state": "ok" if expected == actual else "refused",
3037
  "expected": expected, "actual": actual,
 
5622
  "('O3','2026-07-04T00:00:00Z','Cancelled')")
5623
  ck("orders independently reconcile Sales API counts and exclude cancelled orders",
5624
  red and _validate_orders(con)["state"] == "ok")
5625
+ con.execute("ALTER TABLE amzn_orders ADD COLUMN sales_channel VARCHAR")
5626
+ con.execute("UPDATE amzn_orders SET sales_channel='Amazon.com'")
5627
+ con.execute("INSERT INTO amzn_orders VALUES ('O4','2026-07-03T00:00:00Z','Shipped','Amazon.ca'), "
5628
+ "('O5','2026-07-03T00:00:00Z','Shipped','Non-Amazon')")
5629
+ ck("orders reconcile only the US marketplace that Amazon Sales counts",
5630
+ _validate_orders(con)["state"] == "ok")
5631
  spec = cx.REPORT_TYPES["reimbursements"]
5632
  with patch.object(cx, "report_document", return_value=(
5633
  "sku\tamount\n", {"reportDocumentId": "empty", "createdTime": _iso(end)})):
platform/harness/mirror_store.py CHANGED
@@ -1084,13 +1084,14 @@ def _hold_previous(store, candidate, published, tables):
1084
  def _publication_line(store, report, done, holds, *, snapshot_id=None, why=None):
1085
  """One log line: what a pass published and what it held, each with its reason."""
1086
  rows = report.get("tables") or {}
1087
- synced = sorted(name for name in done if "rows" in (rows.get(name) or {}))
1088
  synced_text = ", ".join(f"{name} {rows[name]['rows']:,} rows" if isinstance(rows[name]["rows"], int)
1089
  else name for name in synced) or "none"
1090
  held = "; ".join(f"{name} ({str(reason)[:160]})" for name, reason in sorted(holds["held"].items())) or "none"
1091
  if snapshot_id:
1092
  text = (f"{store.label} publication {snapshot_id}: published {len(synced)} synced ({synced_text}) and "
1093
- f"{len(set(done) - set(synced))} current; held {len(holds['held'])} at their previous rows: {held}")
 
1094
  else:
1095
  text = f"{store.label} publication held, the previous snapshot stays: {why}; unfinished: {held}"
1096
  return text.replace("—", "-").replace("–", "-").replace("\n", " ").replace("\r", " ")
 
1084
  def _publication_line(store, report, done, holds, *, snapshot_id=None, why=None):
1085
  """One log line: what a pass published and what it held, each with its reason."""
1086
  rows = report.get("tables") or {}
1087
+ synced = sorted(name for name in done if name not in holds["held"] and "rows" in (rows.get(name) or {}))
1088
  synced_text = ", ".join(f"{name} {rows[name]['rows']:,} rows" if isinstance(rows[name]["rows"], int)
1089
  else name for name in synced) or "none"
1090
  held = "; ".join(f"{name} ({str(reason)[:160]})" for name, reason in sorted(holds["held"].items())) or "none"
1091
  if snapshot_id:
1092
  text = (f"{store.label} publication {snapshot_id}: published {len(synced)} synced ({synced_text}) and "
1093
+ f"{len(set(done) - set(synced) - set(holds['held']))} current; "
1094
+ f"held {len(holds['held'])} at their previous rows: {held}")
1095
  else:
1096
  text = f"{store.label} publication held, the previous snapshot stays: {why}; unfinished: {held}"
1097
  return text.replace("—", "-").replace("–", "-").replace("\n", " ").replace("\r", " ")
web/public/AIOS_DEPLOY_RECEIPT CHANGED
@@ -1 +1 @@
1
- df8d6ac42e6acaf4afc92e5742282a91ee0d63b5c1777613b9a0e9f701b7c1df
 
1
+ 458a5fbc527477f2386a8b2ec527a1c2b020148e378bd0d53514b907feff62e9