Task ID: audit-content-expanders-2026-05-14 Layer: Atlas (artifact_detail content rendering) Date: 2026-05-14 v1 carve-out: user-authorized; v1 still serves scidex.ai
{{artifact:ID}} markersThe /paper/<id> route at api.py:30603 calls
_resolve_authored_paper_embeds(db, content) to replace
{{artifact:ID[:view]}} markers with rendered artifact cards. The
/artifact/authored_paper-* branch at api.py:36304 (in
artifact_detail) does not — so the same content shows the raw
markers when viewed via the artifact route. The 2026-05-13 audit
found 9 unique unrendered markers on
authored_paper-seaad-microglia-review-001.
Fix: call _resolve_authored_paper_embeds(db, str(_ap_content))
inside the authored_paper branch of artifact_detail before passing
to _render_collapsible_description / simple_md_to_html. Wrap in
try/except so a broken embed can't sink the whole page render
(matches the conservative pattern around the markdown converter
selection that follows).
{{data:main}} placeholderThe generic metadata table at api.py:34941+ iterates every
metadata.items() and renders them as key/value rows. For
dashboard and dashboard_snapshot artifacts the template_html
field is literally the raw {{data:main}} placeholder (the
dashboard engine substitutes it at render time and stores the result
in rendered_html). Without filtering, the metadata table dumps the
placeholder verbatim and end users see {{data:main}} as if the
page were broken.
Inspecting dashboard-evidence-density-map:
rendered_html length : 17916 chars, no markers
template_html length : 13 chars, "{{data:main}}"The dashboard preview block at api.py:35119 already prefers
rendered_html, so the preview itself is correct. Only the metadata
table leaks the raw placeholder.
Fix: extend the skip_keys set inside the metadata loop to exclude
dashboard-internal state keys (template_html, rendered_html,
view_spec_json, last_render_data, last_render_errors) when
atype in ("dashboard", "dashboard_snapshot"). The dashboard
preview block already shows the substituted output; the raw engine
state belongs in the underlying dashboards table, not in the
artifact view.
python3 -c "import ast; ast.parse(open('api.py').read())" → OK/tmp/audit-2026-05-13/reverify.py. Both R-1 and R-3 should/artifact/authored_paper-seaad-microglia-review-001{{artifact:…}} markers.
/artifact/dashboard-evidence-density-map no longer{{data:main}} anywhere on the page.Low.
_resolve_authored_paper_embeds)/paper/<id>. Wrapped in try/except soartifacts.metadatametadata, not from this table.