> ## Continuous-process anchor
>
> This spec describes an instance of one of the retired-script themes
> documented in docs/design/retired_scripts_patterns.md. Before
> implementing, read:
>
> 1. The "Design principles for continuous processes" section of that
> atlas — every principle is load-bearing. In particular:
> - LLMs for semantic judgment; rules for syntactic validation.
> - Gap-predicate driven, not calendar-driven.
> - Idempotent + version-stamped + observable.
> - No hardcoded entity lists, keyword lists, or canonical-name tables.
> - Three surfaces: FastAPI + orchestra + MCP.
> - Progressive improvement via outcome-feedback loop.
> 2. The theme entry in the atlas matching this task's capability:
> S2, S4 (pick the closest from Atlas A1–A7, Agora AG1–AG5,
> Exchange EX1–EX4, Forge F1–F2, Senate S1–S8, Cross-cutting X1–X2).
> 3. If the theme is not yet rebuilt as a continuous process, follow
> docs/planning/specs/rebuild_theme_template_spec.md to scaffold it
> BEFORE doing the per-instance work.
>
> **Specific scripts named below in this spec are retired and must not
> be rebuilt as one-offs.** Implement (or extend) the corresponding
> continuous process instead.
Quest: Senate Priority: P80 Status: open
CI: Run site health check and fix broken links
This task is part of the Senate quest (Senate layer). It contributes to the broader goal of building out SciDEX's senate capabilities.
timeout 120 scidex status: API and nginx healthy; core services responsive./, /exchange, /gaps, /graph, /analyses/, /atlas.html, /how.html, /senate, /forge) and observed 200/301/302 responses.timeout 300 python3 link_checker.py; crawl hit transient connection-refused events during API cycling and produced systemic false positives./hypothesis/{id} links from artifact metadata even when that hypothesis no longer exists.api.py to only create hypothesis links when the target exists; otherwise render a non-clickable "missing" badge for context.python3 -c "import py_compile; py_compile.compile('api.py', doraise=True)".TestClient on /artifacts: stale links to h-075f1f02 and h-seaad-51323624 are absent.scidex status: API healthy, 76 analyses, 180 hypothesestimeout 300 python3 link_checker.py: crawled 2692 pages, found 21673 broken link referencesRoutes Checked (27 total):
/walkthrough.html was returning 404 — fixed by adding redirect route (task cb52ff0c)/notebooks responds slowly (>15s) but returns 200 — performance issue, not a broken link/walkthrough.html 404 → fixed with 301 redirect to /walkthrough/artifacts 500 (UnboundLocalError: caption) → fixed by moving caption init before if block/target/{id} 500 (TypeError: str vs int) → fixed by int() conversion/agents, /agents/performance 500 → fixed by creating missing DB tablesResult: All 27 main routes healthy. No unresolved broken links.
API Status: API was found DOWN. Restarted with sudo systemctl start scidex-api.service.
Routes Checked (16 key routes):
Result: ✅ Complete — All routes healthy after API restart. No broken links found.
/senate/agent/theorist, /senate/agent/skeptic, /senate/agent/synthesizer, /senate/agent/domain_expert all returning HTTP 500.senate_agent_detail() (api.py:28618) crashes with TypeError: 'NoneType' object is not subscriptable when txn['created_at'] is NULL in token_ledger rows. Secondary: txn['balance_after'] also NULL, crashing :, format.reason, created_at, balance_after — with or ''/or 0 defaults (api.py lines 28615-28627).orchestra sync push, API restarted./datasets returns 404 — this route was never implemented; the Datasets nav link/artifacts?artifact_type=dataset. Removed datasets from DYNAMIC_ROUTES/resources responds slowly (~41s) but returns 200 — performance issue only.Path(__file__).parent / "site" so the checker always uses its own worktree.
Result: ✅ Site healthy. Fixed link_checker.py portability (SITE_DIR). Removed stale /datasets from DYNAMIC_ROUTES./robots.txt returns 404 — crawlers (Applebot, etc.) are requesting it. Not a broken{
"requirements": {
"coding": 8,
"safety": 9
},
"auto_tagged_at": "2026-04-03T22:29:52.509378",
"completion_shas": [
"fdd8e6ad643ed5dee7fb4a7bc0b55d3c404ff568",
"7526cf07dda84d86e1d11680f65ef5b9f230dcf2"
],
"completion_shas_checked_at": "2026-04-12T18:23:13.485853+00:00",
"completion_shas_missing": [
"64fe558f83929f325045740f0d4267ba8515c472",
"bb80043d744abb94030e3730dd1a60d48651b832",
"7e936384d3549cb5456b71d835cdd1bde58a20f6",
"6e1ab4b04f17af50fd37d7dd26cbdf8420d9ff05",
"cf9cf2cab7b4ae3a150c29414e982e00424684a5",
"3d9af869ac8cde93decfd3c5a1e8e9cf6bd1bc5e",
"6e2e86040414591ae7b8e56bc4529c8fa291599e",
"1a034fff6564be6cbc5256fd4578a56e0e71d119",
"0e77076471912acad0990608ab94b12fa00dd664",
"3d360553b4632ae4bf1813c8f359a529e27f54bc",
"12cdaea8e0f2e0d6e11c8a9663e9efd9a333d4de",
"8c2039f33ed35461879b322ae36f72b9859b4b27",
"f7025915f70930c858a64a87549303058da34ada",
"a5a9fcb47806cc9002e88e5032874e2f40d7a826",
"87602b39c927bf74e6c7291e142c40f80b25587c",
"ca994924bfb7dc0c88e9e2b7d0a1ac237d226446",
"ae75c7d29c6d6800ec875582bd3d7bebae22a82b",
"1db999568a800c444550c1585ea539d0f147d572",
"863423b1a9fc8c73d29b44e33d319e36a5f2c507",
"9b7576b30ec0d26368bb67585751094f3a901d72",
"ff9f2cda30c8f1b0a5953f06e94383c8a2ccd2f0",
"dcc1a4c36e4f50b30948bc447cb6446b0131e382"
]
}