--- title: Todo --- ```js const API = "http://127.0.0.1:8000"; const POLL = 15_000; const THIS_REPO = "the-custodian"; ``` ```js // Live poll: tasks + workstreams + topics + contributions const todoState = (async function*() { while (true) { let tasks = [], contribs = [], wsMap = {}, ok = false; try { const [rt, rw, rto, rr, rc] = await Promise.all([ fetch(`${API}/tasks/?limit=500`), fetch(`${API}/workstreams/`), fetch(`${API}/topics/`), fetch(`${API}/repos/`), fetch(`${API}/contributions/`), ]); ok = rt.ok && rw.ok && rto.ok && rr.ok && rc.ok; if (ok) { const [taskList, wsList, topicList, repoList, contribList] = await Promise.all([ rt.json(), rw.json(), rto.json(), rr.json(), rc.json(), ]); const topicMap = Object.fromEntries(topicList.map(t => [t.id, t])); const repoMap = Object.fromEntries(repoList.map(r => [r.id, r])); wsMap = Object.fromEntries(wsList.map(w => [w.id, { ...w, domain: repoMap[w.repo_id]?.domain_slug ?? topicMap[w.topic_id]?.domain_slug ?? "unknown", }])); tasks = taskList.map(t => ({ ...t, workstream_title: wsMap[t.workstream_id]?.title ?? "—", domain: wsMap[t.workstream_id]?.domain ?? "unknown", })); contribs = contribList; } } catch {} yield {tasks, contribs, ok, ts: new Date()}; await new Promise(res => setTimeout(res, POLL)); } })(); ``` ```js const tasks = todoState.tasks ?? []; const contribs = todoState.contribs ?? []; const _ok = todoState.ok ?? false; const _ts = todoState.ts; ``` ```js // ── Classify tasks ──────────────────────────────────────────────────────────── const OPEN_STATUSES = new Set(["todo", "in_progress", "blocked"]); // Internal: custodian domain, open, no [repo:] routing prefix const internal = tasks.filter(t => OPEN_STATUSES.has(t.status) && t.domain === "custodian" && !t.title.includes("[repo:") ); // Ecosystem inbound: tasks routed to this repo from any domain const ecosystem = tasks.filter(t => OPEN_STATUSES.has(t.status) && t.title.toLowerCase().includes(`[repo:${THIS_REPO}]`) ); // Third-party: open contributions (outbound work for upstream repos) const thirdParty = contribs.filter(c => ["draft", "submitted", "acknowledged"].includes(c.status) ); ``` # Todo ```js import {injectTocTop} from "./components/toc-sidebar.js"; import {withDocHelp} from "./components/doc-overlay.js"; // ── KPI sidebar card ────────────────────────────────────────────────────────── const _kpiBox = html`
make api`}
No open todos in this category. ✓
`; return html`No open outbound contributions. ✓
`); } else { display(html`