Task ID: audit-js-fixes-2026-05-14 Layer: Atlas (UI / page-render JS) Date: 2026-05-14 v1 carve-out: user-authorized; v1 still serves scidex.ai
The 2026-05-13 site audit (1,451 page fetches across 4 parallel agents)
found 5 inline-JS parse error clusters affecting every wiki page (~18K
rows), the two top-level listings, and the discuss/retry buttons on
landscape and mission pages.
Root cause shared with the artifact-tab fix (PR #1383): Python
f"""…""" literals collapse \' to bare '. When that bare quote
lands inside an outer single-quoted JS string, the string closes early
and the rest of the line is a syntax error. Chrome aborts parsing of
the whole <script> tag — so subsequent functions defined in the same
block are never created.
There is a separate sub-cluster on plain triple-quoted strings
where {{ group: "scidex" }} was written as if the surrounding
string were an f-string. In a plain string Python preserves the
double braces, so the browser sees ({{ → JS SyntaxError.
Seven \' → \\' replacements in f-string contexts, and one
{{...}} → {...} replacement in a plain triple-quoted block:
api.py:78396 already renders{{...}}{...} in the rendered HTML. No change at thatPre-deploy:
python3 -c "import ast; ast.parse(open('api.py').read())" → OK/tmp/audit-2026-05-13/reverify.py is the regression harness — runsPost-deploy:
scidex.ai.node -c on the inline JS:/wiki/<slug>, /hypotheses/, /experiments/, /landscape/<d>/discuss,/gap/<id>.
scidex-api.Very low. The \\' pattern is the established correct idiom at
api.py:38850, 38878-80 and PRs #1383, #1403. The two
plain-triple-quoted hypothes.is blocks now produce identical JS to
the three other f-string-enclosed ones already on main.