perf(hub): cache the names directory, share state builds, retry stations
Concurrent /api/state polls share one build through LiveState for a short TTL, and every POST and PATCH invalidates it, so a write is never followed by a stale view. The names directory is cached, the first transcript scan reads outside the hub lock, the graph timeline starts at the window begin, and unresolved radio stations are retried on a daemon thread every RETRY_SECONDS instead of failing until restart. 🎯 Fix: 85 % 💥 Break: 8 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 78 🚦 Gate: ⛔ fix 85 % < 90, break 8 % > 5 Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6c63c364bd
commit
96d4d2933c
18 files changed
+299
-32
No files matched your search
@@ -34,7 +34,7 @@ class Sources:
|
||||
sightings = title_sightings(self.transcripts.root, claimed, now) if self.names.due(now) else []
|
||||
sightings += [(claim["session"], claim["agent"], iso_epoch(claim["since"]), "claim") for claim in claims if claim["agent"] and claim["session"] != "-"]
|
||||
self.names.observe(sorted(sightings, key=lambda sighting: (sighting[2] is None, sighting[2] or 0.0)), now)
|
||||
known = {entry["name"] for entry in self.names.listed()}
|
||||
known = set(self.names.directory().by_name)
|
||||
radio = []
|
||||
for row in news:
|
||||
name, ts = agent(row.get("from")), epoch(row.get("ts"))
|
||||
@@ -42,7 +42,7 @@ class Sources:
|
||||
radio.append((f"{PSEUDO}{name}", name, ts, "radio"))
|
||||
known.add(name)
|
||||
self.names.observe(radio, now)
|
||||
return Directory(self.names.listed())
|
||||
return self.names.directory()
|
||||
|
||||
def repositories(self) -> dict:
|
||||
tasks = read_register(self.council / REGISTER)
|
||||
|
||||
Reference in new issue
Block a user