Skip to content

Independent Auditing of AI Agents. Run by human or the agent itself, to answer the most crucial question in the AI Agent Economy. Is the agent doing what is supposed to do? With iFixAi you can have this answer in less than 120 seconds.

chore: auto update plot every friday (#31)

stefyi-4355b9728a654f97
diff --git a/.github/workflows/cloners.yaml b/.github/workflows/cloners.yaml
new file mode 100644
index 0000000..256d055
--- /dev/null
+++ b/.github/workflows/cloners.yaml
@@ -0,0 +1,42 @@
+name: Update Cloners Chart
+
+on:
+ schedule:
+ - cron: "0 12 * * 5"
+
+ workflow_dispatch:
+
+permissions:
+ contents: write
+
+jobs:
+ update:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Setup Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.11"
+
+ - name: Install dependencies
+ run: pip install matplotlib requests
+
+ - name: Update CSV
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: python scripts/update_cloners.py
+
+ - name: Generate chart
+ run: python scripts/plot_cloners.py
+
+ - name: Commit changes
+ run: |
+ git config user.name github-actions
+ git config user.email [email protected]
+ git add data/
+ git commit -m "update cloners chart" || exit 0
+ git push
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index a45c72b..f30de1e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -88,7 +88,6 @@ TESTING.md
OPEN_SOURCE_READINESS.md
TESTS.md
/examples/
-scripts/
docs-content/
website-misalignments-*.md
diff --git a/docs/assets/Unique cloners.csv b/docs/assets/Unique cloners.csv
new file mode 100644
index 0000000..2b0adcd
--- /dev/null
+++ b/docs/assets/Unique cloners.csv
@@ -0,0 +1,34 @@
+"Category","Unique"
+"04/26",0
+"04/27",20
+"04/28",55
+"04/29",6
+"04/30",43
+"05/01",36
+"05/02",48
+"05/03",47
+"05/04",100
+"05/05",50
+"05/06",31
+"05/07",41
+"05/08",53
+"05/09",33
+"05/10",34
+"05/11",58
+"05/12",68
+"05/13",67
+"05/14",42
+"05/15",39
+"05/16",16
+"05/17",23
+"05/18",14
+"05/19",8
+"05/20",12
+"05/21",37
+"05/22",21
+"05/23",7
+"05/24",9
+"05/25",43
+"05/26",16
+"05/27",32
+"05/28",22
diff --git a/docs/assets/cloners_history.json b/docs/assets/cloners_history.json
new file mode 100644
index 0000000..71aee91
--- /dev/null
+++ b/docs/assets/cloners_history.json
@@ -0,0 +1,35 @@
+{
+ "2026-04-26": 0,
+ "2026-04-27": 20,
+ "2026-04-28": 55,
+ "2026-04-29": 6,
+ "2026-04-30": 43,
+ "2026-05-01": 36,
+ "2026-05-02": 48,
+ "2026-05-03": 47,
+ "2026-05-04": 100,
+ "2026-05-05": 50,
+ "2026-05-06": 31,
+ "2026-05-07": 41,
+ "2026-05-08": 53,
+ "2026-05-09": 33,
+ "2026-05-10": 34,
+ "2026-05-11": 58,
+ "2026-05-12": 68,
+ "2026-05-13": 67,
+ "2026-05-14": 42,
+ "2026-05-15": 39,
+ "2026-05-16": 16,
+ "2026-05-17": 23,
+ "2026-05-18": 14,
+ "2026-05-19": 8,
+ "2026-05-20": 12,
+ "2026-05-21": 37,
+ "2026-05-22": 21,
+ "2026-05-23": 7,
+ "2026-05-24": 9,
+ "2026-05-25": 43,
+ "2026-05-26": 16,
+ "2026-05-27": 32,
+ "2026-05-28": 22
+}
\ No newline at end of file
diff --git a/docs/assets/unique_cloners_chart.png b/docs/assets/unique_cloners_chart.png
index 8163010..bd9243b 100644
Binary files a/docs/assets/unique_cloners_chart.png and b/docs/assets/unique_cloners_chart.png differ
diff --git a/scripts/plot_cloners.py b/scripts/plot_cloners.py
new file mode 100644
index 0000000..a180d91
--- /dev/null
+++ b/scripts/plot_cloners.py
@@ -0,0 +1,107 @@
+import csv
+import json
+from datetime import datetime, timedelta
+from pathlib import Path
+
+import matplotlib
+
+matplotlib.use("Agg")
+import matplotlib.pyplot as plt
+import matplotlib.dates as mdates
+
+DATA_DIR = Path(__file__).parent.parent / "docs" / "assets"
+HISTORY_FILE = DATA_DIR / "cloners_history.json"
+CSV_FILE = DATA_DIR / "Unique cloners.csv"
+
+
+def load_history() -> dict[str, int]:
+ if HISTORY_FILE.exists():
+ with open(HISTORY_FILE) as f:
+ return json.load(f)
+ return {}
+
+
+def save_history(history: dict[str, int]) -> None:
+ with open(HISTORY_FILE, "w") as f:
+ json.dump(history, f, indent=2, sort_keys=True)
+
+
+def merge_csv(history: dict[str, int]) -> dict[str, int]:
+ year = datetime.now().year
+ with open(CSV_FILE, newline="", encoding="utf-8-sig") as f:
+ reader = csv.DictReader(f)
+ reader.fieldnames = [k.strip('"') for k in reader.fieldnames]
+ for row in reader:
+ date_str = row["Category"].strip('"')
+ value = int(row["Unique"])
+ try:
+ dt = datetime.strptime(f"{date_str}/{year}", "%m/%d/%Y")
+ except ValueError:
+ continue
+ key = dt.strftime("%Y-%m-%d")
+ history[key] = max(history.get(key, 0), value)
+ return history
+
+
+def plot(history: dict[str, int]) -> Path:
+ dates_sorted = sorted(history.keys())
+ dt_dates = [datetime.strptime(d, "%Y-%m-%d") for d in dates_sorted]
+
+ cumulative: list[int] = []
+ total = 0
+ for d in dates_sorted:
+ total += history[d]
+ cumulative.append(total)
+
+ with plt.xkcd():
+ fig, ax = plt.subplots(figsize=(10, 6))
+ fig.patch.set_facecolor("white")
+ ax.set_facecolor("white")
+
+ ax.plot(dt_dates, cumulative, color="#E8756A", linewidth=2.5)
+ ax.fill_between(dt_dates, cumulative, alpha=0.08, color="#E8756A")
+
+ ax.set_title("Unique Cloners History", fontsize=16, pad=20)
+ ax.set_xlabel("Date", fontsize=12)
+ ax.set_ylabel("Cumulative Unique Cloners", fontsize=12)
+
+ launch = datetime(2026, 4, 27)
+ last_date = max(
+ dt_dates[-1],
+ datetime.now().replace(hour=0, minute=0, second=0, microsecond=0),
+ )
+ days_to_friday = (4 - (launch + timedelta(days=1)).weekday()) % 7
+ first_friday = launch + timedelta(days=1 + days_to_friday)
+ fridays: list[datetime] = []
+ d = first_friday
+ while d <= last_date:
+ fridays.append(d)
+ d += timedelta(weeks=1)
+ weekly_ticks = [launch] + fridays
+ ax.xaxis.set_major_formatter(mdates.DateFormatter("%b %d"))
+ ax.set_xticks(weekly_ticks)
+ fig.autofmt_xdate(rotation=0, ha="center")
+
+ ax.spines["top"].set_visible(False)
+ ax.spines["right"].set_visible(False)
+
+ plt.tight_layout()
+
+ out = DATA_DIR / f"unique_cloners_chart.png"
+ plt.savefig(out, dpi=150, bbox_inches="tight", facecolor="white")
+ plt.close()
+
+ return out
+
+
+def main() -> None:
+ history = load_history()
+ history = merge_csv(history)
+ save_history(history)
+ out = plot(history)
+ print(f"Saved: {out}")
+ print(f"Total unique cloners tracked: {sum(history.values())}")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/scripts/update_cloners.py b/scripts/update_cloners.py
new file mode 100644
index 0000000..87f59c8
--- /dev/null
+++ b/scripts/update_cloners.py
@@ -0,0 +1,64 @@
+import os
+import csv
+import requests
+from pathlib import Path
+from datetime import datetime
+
+OWNER = "ifixai-ai"
+REPO = "iFixAi"
+
+ROOT = Path(__file__).resolve().parent.parent
+DATA_DIR = ROOT / "docs" / "assets"
+
+CSV_FILE = DATA_DIR / "Unique cloners.csv"
+
+TOKEN = os.environ["GITHUB_TOKEN"]
+
+headers = {
+ "Authorization": f"Bearer {TOKEN}",
+ "Accept": "application/vnd.github+json",
+}
+
+url = f"https://api.github.com/repos/{OWNER}/{REPO}/traffic/clones"
+
+response = requests.get(url, headers=headers)
+response.raise_for_status()
+
+data = response.json()["clones"]
+
+existing_dates = set()
+
+if CSV_FILE.exists():
+ with open(CSV_FILE, newline="", encoding="utf-8-sig") as f:
+ reader = csv.DictReader(f)
+ reader.fieldnames = [k.strip('"') for k in reader.fieldnames]
+ for row in reader:
+ existing_dates.add(row["Category"])
+
+rows_to_add = []
+
+for item in data:
+ dt = datetime.fromisoformat(item["timestamp"].replace("Z", "+00:00"))
+ date_str = dt.strftime("%m/%d")
+
+ if date_str not in existing_dates:
+ rows_to_add.append({"Category": f"{date_str}", "Unique": item["uniques"]})
+
+needs_newline = False
+if CSV_FILE.exists() and CSV_FILE.stat().st_size > 0:
+ with open(CSV_FILE, "rb") as f:
+ f.seek(-1, os.SEEK_END)
+ needs_newline = f.read(1) != b"\n"
+
+with open(CSV_FILE, "a", newline="") as f:
+ if needs_newline:
+ f.write("\n")
+ writer = csv.DictWriter(
+ f,
+ fieldnames=["Category", "Unique"],
+ quoting=csv.QUOTE_NONNUMERIC,
+ lineterminator="\n",
+ )
+ writer.writerows(rows_to_add)
+
+print(f"Added {len(rows_to_add)} rows")