> ## 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:
> S3 (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: Search Priority: P82 Status: running Frequency: daily
Check if search results include recently added hypotheses, analyses, and wiki pages. Rebuild indexes if stale.
/api/search endpoint works correctly/api/search?q={term}curl -s http://localhost:8000/api/search?q=test | python3 -m json.toolorchestra task get-next --slot 3 --project SciDEXapi.py (/api/search) and rebuild utility rebuild_fts.pypostgresql://scidex:hypotheses vs hypotheses_fts: 181 / 181, missing 0analyses vs analyses_fts: 77 / 77, missing 0wiki_pages vs wiki_pages_fts: 1786 / 1786, missing 0papers vs papers_fts: 1271 / 1271, missing 0wiki_entities_fts: table missing (not present in DB)
timeout 300 python3 rebuild_fts.py postgresql://scidex:hypotheses_fts, analyses_fts, wiki_pages_fts, papers_fts rebuilt successfullywiki_entities_fts skipped because table does not exist
/home/ubuntu/scidex) was unstable during run due unrelated import failure (ModuleNotFoundError: resource_tracker), so endpoint checks were executed against temporary worktree API instance on 127.0.0.1:8010/api/search returns healthy multi-type results:q=tau → 113 resultsq=Alzheimer → 121 resultsq=Microglial → 104 results
wiki_entities_fts is absentDatabase Status:
Search API Tests:/api/search?q=tau → 30 results, correct types (hypothesis, analysis, entity, etc.)/api/search?q=Microglial → 37 results, most recent "Microglial TREM2 downregulation..." found/api/search?q=Alzheimer → 97 results, 13 analysis results including SEA-AD/api/search?q=parabrachial → 9 results, entity "parabrachial-nucleus-gustatory" found/search → 200 OKDatabase Status:
Search API Tests:/api/search?q=tau → 140 results, types: hypothesis, analysis, entity, etc./api/search?q=Alzheimer → 168 results, all 10 types represented (hypothesis, analysis, entity, gap, notebook, debate, paper, wiki_page, target, experiment)/search page → 200 OKDatabase Status:
Search API Tests:/api/search?q=tau → 53 results (hypothesis, analysis, wiki_page, gap)/api/search?q=Microglial → 26 results (hypothesis, analysis, wiki_page, gap)/search page → 200 OKorchestra task get-next --slot 8 --project SciDEX.timeout 300 env SCIDEX_DB=postgresql://scidex python3 scripts/ci_verify_search_indexes.py.hypotheses_fts, wiki_pages_fts, papers_fts, analyses_fts0/12
migrate_fts5.py (triggered by CI script) against live DB.hypotheses_fts = 181/181wiki_pages_fts = 1786/1786papers_fts = 1271/1271analyses_fts = 77/7712/12 FTS triggers present
/api/search health:curl -i http://localhost:8000/api/search?q=test → HTTP/1.1 200 OKpostgresql://scidex; all sampled titles were returned by /api/search (PASS).
curl http://localhost:8000/search → 200scidex status → API and nginx activeResult: Search indexes were stale/missing and are now rebuilt/current; search endpoint returns valid results including recent content.
git pull --rebase) before running CI checks.scidex status to capture service/database baseline:analyses=83, hypotheses=255, knowledge_edges=1836.
timeout 300 env SCIDEX_DB=postgresql://scidex python3 scripts/ci_verify_search_indexes.pyhypotheses_fts 255/255, wiki_pages_fts 1800/1800, papers_fts 1303/1303, analyses_fts 83/83, triggers 15/15.
curl http://localhost:8000/search → 200curl http://localhost:8000/api/search?q=tau → total_results=121, 9 content types.
YWHAG-Mediated returned 1/1 hit: YWHAG-Mediated TFEB Subcellular Targeting.Neuroinflammation and microglial priming returned analysis hits including SDA-2026-04-04-gap-neuro-microglia-early-ad-20260404.
api_status=000 then recovered to 200 within ~10s); retried checks after service recovery.Database Status:
FTS Index Parity: Search API Tests:/api/search?q=tau → 183 results (hypothesis, wiki_page, etc.)/api/search?q=NLRP3+Mitophagy → 25 results; recent hypothesis h-f10d82a7 returned as top hit ✓/api/search?q=FcRn+Transport → 27 results; h-9d16afa0 (added 2026-04-12) returned ✓/api/search?q=Self-Evolution+Loop → 1 result; wiki page self-evolution (added 2026-04-12) returned ✓/search page → 200 OK