ledger: github repo census 2026-11-02 (top 15 starred repos, >=10k stars)
This commit is contained in:
1 parent
bf68b959e4
commit
bedd7ddbbc
8 files changed
+2104
-11
No files matched your search
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# CHECK -- github repo census 2026-11-02 (extract lane).
|
||||
# Exit 0 iff the committed TSV re-derives from the committed raw.json.
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")" || exit 2
|
||||
exec python3 verify_github_repo_census.py
|
||||
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
# CHECK-wizardwork-census -- verify the wizard-work census TSVs round-trip from the tree.
|
||||
#
|
||||
# Q75 (ledger lane): both TSVs must regenerate from the tree through committed code
|
||||
# and round-trip -- every line has the declared field count, every path exists on
|
||||
# disk, no duplicates. This verifier is red on a line whose path is absent from disk
|
||||
# and on a line with the wrong field count (the two negative cells: the injected
|
||||
# beam/CHECK body, and a deleted row), and green once both tables are clean.
|
||||
#
|
||||
# Usage: CHECK-wizardwork-census [tsv1] [tsv2]
|
||||
# defaults: wizardwork-file-manifest.tsv wizardwork-census.tsv (in this directory)
|
||||
#
|
||||
# Exit codes (repo tools/ contract): 0 clean, 1 graded a fault, 2 could not grade.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$(readlink -f "$0")")"
|
||||
|
||||
ROOT="$(pwd)/.." # wizard-work dir, parent of ledger/
|
||||
TSV1="${1:-wizardwork-file-manifest.tsv}"
|
||||
TSV2="${2:-wizardwork-census.tsv}"
|
||||
|
||||
python3 - "$ROOT" "$TSV1" "$TSV2" <<'PY'
|
||||
import os, sys
|
||||
from pathlib import Path
|
||||
root = Path(sys.argv[1]).resolve()
|
||||
if not root.is_dir():
|
||||
print(f'CHECK-wizardwork-census: cannot grade -- wizard-work root {root} missing')
|
||||
sys.exit(2)
|
||||
fails = []
|
||||
tables = 0
|
||||
for tsv in sys.argv[2:]:
|
||||
p = Path(tsv)
|
||||
if not p.is_absolute():
|
||||
p = Path.cwd() / p
|
||||
if not p.is_file():
|
||||
print(f'CHECK-wizardwork-census: cannot grade -- {p} missing')
|
||||
sys.exit(2)
|
||||
tables += 1
|
||||
seen = set()
|
||||
n4 = nbad = 0
|
||||
with open(p) as f:
|
||||
for ln, line in enumerate(f, 1):
|
||||
line = line.rstrip('\n')
|
||||
if not line:
|
||||
continue
|
||||
parts = line.split('\t')
|
||||
if len(parts) != 4:
|
||||
nbad += 1
|
||||
fails.append(f'{p.name}:{ln}: wrong field count {len(parts)}')
|
||||
continue
|
||||
n4 += 1
|
||||
rel, size, fn, top = parts
|
||||
if rel in seen:
|
||||
fails.append(f'{p.name}:{ln}: duplicate path {rel}')
|
||||
seen.add(rel)
|
||||
if not (root / rel).exists():
|
||||
fails.append(f'{p.name}:{ln}: absent path {rel}')
|
||||
print(f'{p.name}: {n4} well-formed rows, {nbad} malformed lines, {len(seen)} distinct paths')
|
||||
print(f'CHECK-wizardwork-census: checked {tables} tables against {root}')
|
||||
if fails:
|
||||
print('CHECK-wizardwork-census: FAIL')
|
||||
for f in fails[:25]:
|
||||
print(' ', f)
|
||||
sys.exit(1)
|
||||
print('CHECK-wizardwork-census: OK -- every line 4 fields, every path on disk, no duplicates')
|
||||
sys.exit(0)
|
||||
PY
|
||||
@@ -1,7 +1,6 @@
|
||||
import subprocess, collections, json, sys
|
||||
import subprocess, collections, json
|
||||
REPO="/root/troupe-standup"
|
||||
HEAD=subprocess.run(["git","-C",REPO,"rev-parse","HEAD"],check=True,capture_output=True,text=True).stdout.strip()
|
||||
out = subprocess.run(["git","-C",REPO,"log","--format=%an%x00%ae"],check=True,capture_output=True,text=True).stdout
|
||||
def canon(name):
|
||||
n=(name or "").strip().lower()
|
||||
if "timmy" in n: return "timmy"
|
||||
@@ -9,16 +8,18 @@ def canon(name):
|
||||
if "cassian" in n: return "cassian-assayborn"
|
||||
if "volt" in n: return "volt"
|
||||
return n
|
||||
def derive(rev):
|
||||
out=subprocess.run(["git","-C",REPO,"log","--format=%an",rev],check=True,capture_output=True,text=True).stdout
|
||||
cnt=collections.Counter()
|
||||
for line in out.split("\n"):
|
||||
if not line: continue
|
||||
n,e=line.split("\x00"); cnt[canon(n)]+=1
|
||||
rows=sorted(cnt.items(), key=lambda kv:(-kv[1],kv[0]))
|
||||
print("HEAD", HEAD, "distinct handles:", len(cnt))
|
||||
for h,c in rows: print(f"{c:6d} {h}")
|
||||
# rebuild CSV (replaces artifact at current HEAD)
|
||||
with open("/root/troupe-standup/wizard-work/ledger/2026-11-02-wizard-handle-census.csv","w") as f:
|
||||
cnt[canon(line)]+=1
|
||||
return sorted(cnt.items(), key=lambda kv:(-kv[1],kv[0]))
|
||||
rows=derive(HEAD)
|
||||
with open("wizard-work/ledger/2026-11-02-wizard-handle-census.csv","w") as f:
|
||||
f.write("handle,commit_count\n"+ "".join(f"{h},{c}\n" for h,c in rows))
|
||||
with open("/root/troupe-standup/wizard-work/ledger/2026-11-02-wizard-handle-census.manifest.json","w") as f:
|
||||
json.dump({"pin_rev":HEAD,"row_count":len(rows),"schema":{"handle":"str","commit_count":"int"},"derived_from":"git log --format=%an%x00%ae across whole history"},f,indent=2)
|
||||
print("rebuilt csv/manifest at rev", HEAD)
|
||||
meta={"pin_rev":HEAD,"row_count":len(rows),"schema":{"handle":"str","commit_count":"int"},"derived_from":"git log --format=%an <pin_rev>"}
|
||||
with open("wizard-work/ledger/2026-11-02-wizard-handle-census.manifest.json","w") as f:
|
||||
json.dump(meta,f,indent=2)
|
||||
print("pin",HEAD,"rows",len(rows))
|
||||
for h,c in rows: print(f"{c:6d} {h}")
|
||||
@@ -0,0 +1,84 @@
|
||||
#!/usr/bin/env python3
|
||||
"""extract_github_repo_census.py
|
||||
|
||||
Extract the 15 most-starred GitHub repositories (>=10000 stars) into a TSV
|
||||
table. Single live API query (unauthenticated search), one call.
|
||||
|
||||
Source:
|
||||
https://api.github.com/search/repositories?q=stars:>=10000&per_page=15&sort=stars&order=desc
|
||||
|
||||
Outputs (same dir as this script):
|
||||
github-repo-census-2026-11-02.tsv ranked table (rank, repo, owner, description,
|
||||
stars, forks, language, url)
|
||||
github-repo-census-2026-11-02.raw.json raw API reply
|
||||
github-repo-census-2026-11-02.manifest.json extract manifest
|
||||
"""
|
||||
import csv
|
||||
import json
|
||||
import urllib.request
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
|
||||
OUT = Path(__file__).resolve().parent
|
||||
TSV = OUT / "github-repo-census-2026-11-02.tsv"
|
||||
RAW = OUT / "github-repo-census-2026-11-02.raw.json"
|
||||
MAN = OUT / "github-repo-census-2026-11-02.manifest.json"
|
||||
|
||||
SOURCE = ("https://api.github.com/search/repositories"
|
||||
"?q=stars:>=10000&per_page=15&sort=stars&order=desc")
|
||||
HEADERS = {"User-Agent": "ledger-wizard/1.0",
|
||||
"Accept": "application/vnd.github+json"}
|
||||
|
||||
|
||||
def fetch():
|
||||
req = urllib.request.Request(SOURCE, headers=HEADERS)
|
||||
with urllib.request.urlopen(req, timeout=30) as r:
|
||||
return json.loads(r.read(4 * 1024 * 1024))
|
||||
|
||||
|
||||
def main():
|
||||
api = fetch()
|
||||
items = sorted(api.get("items", []),
|
||||
key=lambda i: i.get("stargazers_count", 0), reverse=True)[:15]
|
||||
rows = []
|
||||
for i, it in enumerate(items, 1):
|
||||
rows.append({
|
||||
"rank": i,
|
||||
"repo": it.get("name", ""),
|
||||
"owner": (it.get("owner") or {}).get("login", ""),
|
||||
"description": (it.get("description") or "").strip(),
|
||||
"stars": it.get("stargazers_count", 0),
|
||||
"forks": it.get("forks_count", 0),
|
||||
"language": (it.get("language") or "").strip(),
|
||||
"url": it.get("html_url", ""),
|
||||
})
|
||||
with TSV.open("w", encoding="utf-8", newline="") as f:
|
||||
w = csv.DictWriter(f,
|
||||
fieldnames=["rank", "repo", "owner", "description",
|
||||
"stars", "forks", "language", "url"],
|
||||
delimiter="\t", lineterminator="\n")
|
||||
w.writeheader()
|
||||
w.writerows(rows)
|
||||
RAW.write_text(json.dumps(api, indent=1, ensure_ascii=False), encoding="utf-8")
|
||||
manifest = {
|
||||
"schema": "github-repo-census-v1",
|
||||
"source": SOURCE,
|
||||
"extracted_at_utc": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
|
||||
"generated_by": "extract_github_repo_census.py (urllib -> api.github.com)",
|
||||
"rows": len(rows),
|
||||
"columns": ["rank", "repo", "owner", "description", "stars", "forks",
|
||||
"language", "url"],
|
||||
"verification": ("CHECK github-repo-census-2026-11-02.sh "
|
||||
"(independent re-derivation from raw.json; exit 0 iff equal)"),
|
||||
"total_count": api.get("total_count"),
|
||||
}
|
||||
MAN.write_text(json.dumps(manifest, indent=2, ensure_ascii=False), encoding="utf-8")
|
||||
print("API total_count:", api.get("total_count"))
|
||||
print("rows written:", len(rows))
|
||||
for r in rows[:3]:
|
||||
print(r["repo"], r["stars"], r["owner"], "|", r["language"])
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"schema": "github-repo-census-v1",
|
||||
"source": "https://api.github.com/search/repositories?q=stars:>=10000&per_page=15&sort=stars&order=desc",
|
||||
"extracted_at_utc": "2026-11-02T16:35:31Z",
|
||||
"generated_by": "extract_github_repo_census.py (urllib -> api.github.com)",
|
||||
"rows": 15,
|
||||
"columns": [
|
||||
"rank",
|
||||
"repo",
|
||||
"owner",
|
||||
"description",
|
||||
"stars",
|
||||
"forks",
|
||||
"language",
|
||||
"url"
|
||||
],
|
||||
"verification": "CHECK github-repo-census-2026-11-02.sh (independent re-derivation from raw.json; exit 0 iff equal)",
|
||||
"total_count": 5718
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,16 @@
|
||||
rank repo owner description stars forks language url
|
||||
1 build-your-own-x codecrafters-io Master programming by recreating your favorite technologies from scratch. 558771 52283 Markdown https://github.com/codecrafters-io/build-your-own-x
|
||||
2 awesome sindresorhus 😎 Awesome lists about all kinds of interesting topics [NOTE: Pull requests are temporarily disabled until I have a chance to catch up with the existing ones] 529455 37998 https://github.com/sindresorhus/awesome
|
||||
3 public-apis public-apis A collective list of free APIs 495400 55284 Python https://github.com/public-apis/public-apis
|
||||
4 freeCodeCamp freeCodeCamp freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free. 458437 48188 TypeScript https://github.com/freeCodeCamp/freeCodeCamp
|
||||
5 rea morluto Reverse engineer anything with agents, from app behavior down to native binaries. 421817 105236 TypeScript https://github.com/morluto/rea
|
||||
6 free-programming-books EbookFoundation :books: Freely available programming books 400738 67064 Python https://github.com/EbookFoundation/free-programming-books
|
||||
7 openclaw openclaw The AI that really does things. Any OS. Any Platform. The lobster way. 🦞 393723 82750 TypeScript https://github.com/openclaw/openclaw
|
||||
8 system-design-primer donnemartin Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards. 376538 59128 Python https://github.com/donnemartin/system-design-primer
|
||||
9 developer-roadmap nilbuild Interactive roadmaps, guides and other educational content to help developers grow in their careers. 371069 45183 TypeScript https://github.com/nilbuild/developer-roadmap
|
||||
10 coding-interview-university jwasham A complete computer science study plan to become a software engineer. 363702 85172 https://github.com/jwasham/coding-interview-university
|
||||
11 awesome-selfhosted awesome-selfhosted A list of Free Software network services and web applications which can be hosted on your own servers 333028 15691 https://github.com/awesome-selfhosted/awesome-selfhosted
|
||||
12 awesome-python vinta "The definitive list that answers ""I want to do X in Python, which tool should I use?""" 331957 29053 Python https://github.com/vinta/awesome-python
|
||||
13 superpowers obra An agentic skills framework & software development methodology that works. 311058 27680 Shell https://github.com/obra/superpowers
|
||||
14 skills mattpocock Skills for Real Engineers. Straight from my .agents directory. 309944 26076 Shell https://github.com/mattpocock/skills
|
||||
15 ECC affaan-m The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond. 295351 43712 JavaScript https://github.com/affaan-m/ECC
|
||||
|
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env python3
|
||||
"""verify_github_repo_census.py
|
||||
|
||||
Verifier for the github-repo-census-2026-11-02 artifact (extract lane).
|
||||
|
||||
Independent re-derivation: rebuilds the expected TSV from the committed
|
||||
raw.json (no import of the extractor), then compares field-for-field with
|
||||
the committed TSV and runs structural checks. Exit code IS the verdict:
|
||||
0 iff everything matches, 1 on any mismatch.
|
||||
"""
|
||||
import csv
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
RAW = HERE / "github-repo-census-2026-11-02.raw.json"
|
||||
TSV = HERE / "github-repo-census-2026-11-02.tsv"
|
||||
FIELDS = ["rank", "repo", "owner", "description", "stars", "forks", "language", "url"]
|
||||
|
||||
|
||||
def derive():
|
||||
api = json.loads(RAW.read_text(encoding="utf-8"))
|
||||
items = sorted(api.get("items", []),
|
||||
key=lambda i: i.get("stargazers_count", 0), reverse=True)[:15]
|
||||
out = []
|
||||
for i, it in enumerate(items, 1):
|
||||
out.append({
|
||||
"rank": i,
|
||||
"repo": it.get("name", ""),
|
||||
"owner": (it.get("owner") or {}).get("login", ""),
|
||||
"description": (it.get("description") or "").strip(),
|
||||
"stars": it.get("stargazers_count", 0),
|
||||
"forks": it.get("forks_count", 0),
|
||||
"language": (it.get("language") or "").strip(),
|
||||
"url": it.get("html_url", ""),
|
||||
})
|
||||
return out
|
||||
|
||||
|
||||
def read_committed():
|
||||
with TSV.open(encoding="utf-8", newline="") as f:
|
||||
return list(csv.DictReader(f, delimiter="\t"))
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
expected = derive()
|
||||
except Exception as exc: # noqa: BLE001
|
||||
print(f"[fail] could not re-derive from raw.json: {exc}")
|
||||
return 1
|
||||
try:
|
||||
committed = read_committed()
|
||||
except Exception as exc: # noqa: BLE001
|
||||
print(f"[fail] could not read committed TSV: {exc}")
|
||||
return 1
|
||||
|
||||
problems = []
|
||||
|
||||
# Structural checks.
|
||||
if len(committed) != len(expected):
|
||||
problems.append(f"row count: committed={len(committed)} expected={len(expected)}")
|
||||
stars = [int(r.get("stars", -1)) for r in committed]
|
||||
if stars != sorted(stars, reverse=True):
|
||||
problems.append("stars not sorted non-increasing")
|
||||
if [r.get("rank") for r in committed] != [str(i) for i in range(1, len(committed) + 1)]:
|
||||
problems.append("rank column not 1..N")
|
||||
if len({r.get("repo") for r in committed}) != len(committed):
|
||||
problems.append("duplicate repo names")
|
||||
for r in committed:
|
||||
if not r.get("url", "").startswith("https://github.com/"):
|
||||
problems.append(f"bad url: {r.get('url')}")
|
||||
break
|
||||
|
||||
# Field-for-field comparison of the full table.
|
||||
if len(committed) == len(expected):
|
||||
for i, (c, e) in enumerate(zip(committed, expected), 1):
|
||||
for field in FIELDS:
|
||||
if c.get(field) != str(e[field]):
|
||||
problems.append(f"row {i} field {field}: committed={c.get(field)!r} "
|
||||
f"expected={e[field]!r}")
|
||||
|
||||
if problems:
|
||||
print("[fail] census verification mismatches:")
|
||||
for p in problems:
|
||||
print(" -", p)
|
||||
return 1
|
||||
print(f"[ok] census verified: {len(committed)} rows, sorted desc by stars, "
|
||||
f"no duplicate repos, table equals independent re-derivation from raw.json")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in new issue
Block a user