Task ID: experiment-wiki-crosslinks-restore-2026-05-18
Layer: Atlas (artifact_detail)
Date: 2026-05-18
Status: open — follow-up to experiment-artifact-extras-2026-05-13
Priority: high (real product gap + a permanently-broken test)
v1 carve-out: user-authorized; v1 still serves scidex.ai
tests/test_wiki_crosslinks.py::test_experiment_detail_shows_wiki_crosslinks
fails: it does client.get("/experiment/<slug>", follow_redirects=False),
asserts status_code == 200, and asserts "📖 Wiki Pages" in html. The
route now 301-redirects (no body) and the string no longer exists.
This is not a regression from PR #1413. Timeline (from git log):
a1c9c112e, 2026-04-16./experiment/{artifact_id:path} added:11bbe3c4b (PR #1229), 2026-04-28 — broke the test that day.
experiment_detail handler (which contained the 📖 Wiki PagesThe deeper issue: the 📖 Wiki Pages panel was a **real, user-facing
capability** that the redirect silently dropped on 2026-04-28.
artifact_detail has a Related Wiki Pages panel
(_hyp_related_wiki_panel, api.py:34772, header entity 📙 📙)
but it is hypothesis-only — it queries
target_artifact_id = 'hypothesis-{id}' and is wired solely into the
hypothesis branch's Evidence section. /artifact/<exp_id> surfaces **no
wiki crosslinks for experiments under any heading**. So experiment→wiki
crosslinks have been missing from the product since 2026-04-28.
Restore the capability on the canonical page, then unbreak the test.
_render_experiment_extras_html** (insert into sections,return at ~api.py:31436)._hyp_related_wiki_panel (api.py:34772–34802)
SELECT wp.slug, wp.title, wp.entity_type, MAX(al.strength) AS strength
FROM artifact_links al
JOIN wiki_pages wp ON wp.slug = SUBSTR(al.source_artifact_id, 6)
WHERE al.target_artifact_id = %s
AND al.source_artifact_id LIKE 'wiki-%'
GROUP BY wp.slug, wp.title, wp.entity_type
ORDER BY strength DESC LIMIT 15 Key-form caveat — verify before shipping. The deleted handler
keyed target_artifact_id on experiment-<id>; the new artifact
page is reached at the bare <id>. artifact_links may hold the
crosslink under either form. Probe the live DB for the fixture the
test uses (_find_artifact_with_wiki_links("experiment")) and key
the query on whichever form actually has rows — or query both with
target_artifact_id IN (%s, 'experiment-' || %s). Do not assume.
Gate the section on a non-empty result (consistent with every other
block in the helper).
follow_redirects=False → True and assertRelated Wiki Pages wording as _hyp_related_wiki_panel (📙📙, not 📖) so the assertion becomesassert "Related Wiki Pages" in html. While here, also fixtest_analysis_detail_shows_wiki_crosslinks (same redirect breakage,test_direct_join_query_returns_results? placeholders + positional row indexing — broken on_find_artifact_with_wiki_links("experiment"); confirm/artifact/<id> now renders a "Related Wiki Pages" panel with thepytest tests/test_wiki_crosslinks.py passes all four methods.artifact_links rows.
scidex-api, confirm live render (see