Applied from worktree-agent-ad6e17cbc4ea0c94b (commit 0a0fe314)
with manual re-apply onto post-cluster-26 HEAD:
- Parser: parse-on-feat collects `having margin X threshold Y`
clauses between `from X` and the body; packs them into a
`:having {"margin" M "threshold" T}` dict on the parts list.
- Compiler: scan-on threads a new `having-info` parameter through
all recursions; when event-name is "intersection", wraps the
hs-on call with `(do on-call (hs-on-intersection-attach! target
margin threshold))`.
- Runtime: hs-on-intersection-attach! constructs an
IntersectionObserver with {rootMargin, threshold} options and a
callback that dispatches an "intersection" DOM event carrying
{intersecting, entry} detail.
- Runner: HsIntersectionObserver mock fires the callback
synchronously on observe() with isIntersecting=true so handlers
run during activation; ignores margin/threshold (tests assert
only that the handler fires).
Suite hs-upstream-on: 33/70 -> 36/70 (on intersection: 0/3 -> 3/3).
Smoke 0-195 unchanged at 165/195.