--- title: Todo --- ```js import {API, POLL_HEAVY, apiFetch, pollDelay, waitForVisible} from "./components/config.js"; const THIS_REPO = "the-custodian"; ``` ```js // Live poll: tasks + workstreams + topics + contributions const todoState = (async function*() { let failures = 0; while (true) { let tasks = [], contribs = [], improvements = [], wsMap = {}, ok = false; try { const [rt, rw, rto, rr, rc, ri] = await Promise.all([ apiFetch("/tasks/?limit=500"), apiFetch("/workplans/"), apiFetch("/topics/"), apiFetch("/repos/"), apiFetch("/contributions/"), apiFetch("/technical-debt/?debt_type=dashboard-improvement"), ]); 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; const CLOSED = new Set(["finished", "wont_fix", "resolved", "deferred"]); improvements = ri.ok ? (await ri.json()).filter(t => t.debt_type === "dashboard-improvement" && !CLOSED.has(t.status)) : []; } } catch {} failures = ok ? 0 : failures + 1; yield {tasks, contribs, improvements, ok, ts: new Date()}; await waitForVisible(pollDelay({ok, base: POLL_HEAVY, failures})); } })(); ``` ```js const tasks = todoState.tasks ?? []; const contribs = todoState.contribs ?? []; const improvements = todoState.improvements ?? []; const _ok = todoState.ok ?? false; const _ts = todoState.ts; ``` ```js // ── Classify tasks ──────────────────────────────────────────────────────────── const OPEN_STATUSES = new Set(["wait", "todo", "progress"]); // 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`
Todo Summary
internal
${internal.length}
ecosystem (inbound)
${ecosystem.length}
third-party (outbound)
${thirdParty.length}
suggestions (open)
${improvements.length}
`; // ── Live indicator ──────────────────────────────────────────────────────────── const _liveEl = html`
${_ok ? `Live · updated ${_ts?.toLocaleTimeString()}` : html`Offline — run: make api`}
`; withDocHelp(_liveEl, "/docs/live-data"); injectTocTop("todo-kpi-box", _kpiBox); injectTocTop("live-indicator", _liveEl); const _h1 = document.querySelector("#observablehq-main h1"); if (_h1) { _h1.style.position = "relative"; withDocHelp(_h1, "/docs/todo"); } ``` --- ## Internal Work fully addressable within this repo. Open tasks in custodian workstreams without a cross-repo routing prefix. ```js const PRIORITY_ORDER = {critical: 0, high: 1, medium: 2, low: 3}; const STATUS_ORDER = {wait: 0, progress: 1, todo: 2}; function sortTasks(arr) { return [...arr].sort((a, b) => { const sd = (STATUS_ORDER[a.status] ?? 9) - (STATUS_ORDER[b.status] ?? 9); if (sd !== 0) return sd; return (PRIORITY_ORDER[a.priority] ?? 9) - (PRIORITY_ORDER[b.priority] ?? 9); }); } function renderTaskList(arr) { if (arr.length === 0) return html`

No open todos in this category. ✓

`; return html`
${sortTasks(arr).map(t => html`
${t.priority} ${t.status.replace("_", " ")} ${t.workstream_title} ${t.assignee ? html`@${t.assignee}` : ""}
${t.title}
${t.blocking_reason ? html`
⊘ ${t.blocking_reason}
` : ""}
`)}
`; } display(renderTaskList(internal)); ``` --- ## Ecosystem Inbound tasks routed to this repo by other agents via the `[repo:${THIS_REPO}]` prefix convention. ```js display(renderTaskList(ecosystem)); ``` --- ## Third-Party Outbound work for upstream repos — open contribution artifacts (bug reports, feature requests, extension points, upstream PRs). ```js const TYPE_LABEL = {br: "Bug Report", fr: "Feature Request", ep: "Extension Point", upr: "Upstream PR"}; const STATUS_COLOR_C = {draft: "#94a3b8", submitted: "#3b82f6", acknowledged: "#f59e0b"}; if (thirdParty.length === 0) { display(html`

No open outbound contributions. ✓

`); } else { display(html`
${thirdParty.map(c => html`
${TYPE_LABEL[c.type] ?? c.type} ${c.status} ${c.target_org ? html`${c.target_org}` : ""} ${c.target_repo ? html`${c.target_repo}` : ""}
${c.title}
${c.body_path ? html`
↗ ${c.body_path}
` : ""}
`)}
`); } ``` --- ## Suggestions Dashboard suggestions submitted via Shift+click. Review and action on the [UI Feedback](/ui-feedback) page; open items shown here for visibility. ```js if (improvements.length === 0) { display(html`

No open suggestions. Shift+click any widget to submit one.

`); } else { display(html`
${improvements.map(t => html`
improvement ${t.location ?? ""} review →
${t.title.replace(/^UI:\s*/, "")}
${t.description ? html`
${t.description.slice(0, 200)}${t.description.length > 200 ? " …" : ""}
` : ""}
`)}
`); } ```