The town: a fake community across the pasture, checked for coherence
tools/pasture/town/ (run through tools/pasture/town.sh) seeds a fake community across every running peer and checks that all of them, and PrivaPub, agree on what happened: - drivers per platform on four dialect bases (Mastodon API, Misskey API, Lemmy API, PrivaPub with /clientapi), each with a selftest against its own server; what a server holds is read from its database, never by making it fetch; - a deterministic generator (specs/village.json: 23 accounts on seven servers, roots with several personas, circles and communities, a cross-server follow graph, posts of every kind and visibility, reply rounds, likes, boosts, reactions, votes, edits, deletes, blocks, mutes and a report) and a seeder that keeps a ledger of what happened; - a sweep that expects delivery and confinement per server, what each account sees, counts, threads, edits, deletes, follows and privacy rows (sibling keys, published days, canary root credentials in every peer's database, located posts that never leave), with what the peers do on purpose modelled (Misskey drops orphan replies, Lemmy keeps only community content, edits go to the post's own audience); - known gaps (gaps.json) turn failures into xfail and passes into xpass; a self-contained report.html, and docs/INTEROP-BACKLOG.md. The pasture moves to a public-looking subnet (peers with no private address switch can join), takes PASTURE_PORT when 6971 is in use, adds peers to a running pasture (run.sh add, Caddy recreated with its CA kept), removes its volumes on down, writes every scenario check to out/scenarios.jsonl, serves decePub as decepub.test for its e2e tests, lifts GoToSocial's and Lemmy's own rate limits, trusts Caddy in Mastodon (TRUSTED_PROXY_IP) and gains Hollo (Fedify), whose one login owning several accounts is the nearest peer to PrivaPub's personas. The first village found the four PrivaPub bugs fixed in the commits before this one; the second run, on the fixed server, passes 2319 checks with 11 failures left, all between peers or from Lemmy's send worker, which the seeder now warms up first. ROADMAP records the owner's decisions of 2026-10-04 (the town, and P9 back from the cut list). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
d6131af289
commit
2873344690
46 files changed
+4400
-24
No files matched your search
@@ -0,0 +1,86 @@
|
||||
"""docs/INTEROP-BACKLOG.md from the latest town results, the bash scenarios and decePub's e2e cells: new failures (to fix
|
||||
or to record in gaps.json), known gaps by phase, known gaps now passing (close them), and the scenarios' failures.
|
||||
|
||||
town.sh backlog [run] [--write]"""
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from collections import defaultdict
|
||||
|
||||
import check
|
||||
import seed
|
||||
|
||||
DOCS = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))), "docs")
|
||||
|
||||
|
||||
def load_jsonl(path):
|
||||
if not os.path.exists(path):
|
||||
return []
|
||||
with open(path) as f:
|
||||
return [json.loads(line) for line in f if line.strip()]
|
||||
|
||||
|
||||
def main(args):
|
||||
name = next((a for a in args if not a.startswith("--")), "village")
|
||||
run_dir = seed.run_dir(name)
|
||||
with open(os.path.join(run_dir, "results.json")) as f:
|
||||
result = json.load(f)
|
||||
gaps = {g["id"]: g for g in check.load_gaps()}
|
||||
client = check.classify([dict(c) for c in load_jsonl(os.path.join(seed.OUT, "client.jsonl"))], list(gaps.values()))
|
||||
scenarios = load_jsonl(os.path.join(seed.OUT, "scenarios.jsonl"))
|
||||
checks = result["checks"] + client
|
||||
|
||||
new = defaultdict(list)
|
||||
known = defaultdict(list)
|
||||
closing = defaultdict(list)
|
||||
for c in checks:
|
||||
if c["status"] == "fail":
|
||||
new[c["cell"]].append(c)
|
||||
elif c["status"] == "xfail":
|
||||
known[c["gap"]].append(c)
|
||||
elif c["status"] == "xpass":
|
||||
closing[c["gap"]].append(c)
|
||||
|
||||
lines = ["# Interop backlog", "",
|
||||
f"Generated by `tools/pasture/town.sh backlog --write` from `{os.path.basename(run_dir)}` on "
|
||||
f"{time.strftime('%Y-%m-%d', time.gmtime())}. Do not edit by hand: fix the cause, or record a known gap in "
|
||||
"`tools/pasture/town/gaps.json`, and generate it again.", "",
|
||||
f"Checks: {sum(1 for c in checks if c['status'] == 'pass')} pass, {sum(1 for c in checks if c['status'] == 'fail')} "
|
||||
f"fail, {sum(1 for c in checks if c['status'] == 'xfail')} known gaps, "
|
||||
f"{sum(1 for c in checks if c['status'] == 'xpass')} known gaps now passing.", ""]
|
||||
lines += ["## New failures", ""]
|
||||
if not new:
|
||||
lines.append("None.")
|
||||
for cell, cs in sorted(new.items(), key=lambda kv: -len(kv[1])):
|
||||
ex = cs[0]
|
||||
got = " ".join(str(ex.get("got")).replace("`", "'").split())[:140]
|
||||
lines.append(f"- **`{cell}`**: {len(cs)} failing. Example: {ex.get('ref') or ''} expected `{ex.get('expect')}`, "
|
||||
f"got `{got}`" + (f" ({ex['how']})" if ex.get("how") else "") + ".")
|
||||
lines += ["", "## Known gaps still failing", ""]
|
||||
if not known:
|
||||
lines.append("None.")
|
||||
for gid, cs in sorted(known.items()):
|
||||
g = gaps.get(gid, {})
|
||||
lines.append(f"- **{gid}** ({g.get('kind')}, {g.get('phase')}): {g.get('title')}. {len(cs)} checks. "
|
||||
+ (f"Code: `{g['code']}`." if g.get("code") else ""))
|
||||
lines += ["", "## Known gaps now passing (close them)", ""]
|
||||
if not closing:
|
||||
lines.append("None.")
|
||||
for gid, cs in sorted(closing.items()):
|
||||
lines.append(f"- **{gid}**: {gaps.get(gid, {}).get('title')}. {len(cs)} checks pass.")
|
||||
lines += ["", "## Scenario failures", ""]
|
||||
bad = [s for s in scenarios if s["status"] == "fail"]
|
||||
lines += [f"- {s['peer']}: {s['check']}" for s in bad] or ["None."]
|
||||
text = "\n".join(lines) + "\n"
|
||||
if "--write" in args:
|
||||
with open(os.path.join(DOCS, "INTEROP-BACKLOG.md"), "w") as f:
|
||||
f.write(text)
|
||||
print(os.path.join(DOCS, "INTEROP-BACKLOG.md"))
|
||||
else:
|
||||
print(text)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv[1:]))
|
||||
Reference in new issue
Block a user