Fix correctness, robustness, and tooling issues from code review
Render: escape `<` to < in the embedded JSON so a `</script>` in any
string (e.g. a Haddock comment) can't close the data <script> early or
inject markup.
viewer.js:
- Haddock markdown links: allowlist http(s)/mailto/relative targets so a
`javascript:`/`data:` URL in a doc comment can't become a clickable XSS.
- reduceTypeArg: iterate the family index (which folds in closed-family
`tfEquations`) instead of only `pdFamInstances`, so closed-family
applications actually reduce instead of showing as unresolved.
- matchTypeArg: one-sided matching — a head variable is polymorphic and
matches anything, but a variable left on the requirement side is
abstract and no longer matches concrete instances (kills false
"satisfied" edges).
- Instance-view node ids use the stable global _idx so the focused and
superclass-matched representations of one instance collapse to a single
node and a filtered-out instance can't reappear under a second id.
- escapeAttr now delegates to escape (one implementation).
Extract:
- Data-family constructor arg types are substituted from the rep TyCon's
tyvars to the fam-instance's, so positional TyVarRefs resolve instead of
degrading to OtherArg.
- Representational equality renders as the `Coercible a b` constraint
(prefix) rather than infix.
- Drop the always-Just Maybe from extractClass.
Merge:
- Sort dumps by (package, module) before merging so dedup ("first wins")
and output ordering are reproducible across filesystems.
- normalisePackageId: treat a segment as a version only when it is
digits-and-dots, not merely digit-led (avoids truncating names like
base16-bytestring).
Plugin: document the purePlugin incremental-build behavior and the
clean-build caveat.
classgraph-plugin-flag.sh: collect every candidate .so (local build tree +
each cabal store that actually registers classgraph), offer a numbered
chooser when more than one is found, and stop an expected ghc-pkg failure
from tripping `set -e`.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>